From nobody Tue Jan 9 13:30:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T8WyM6Qdbz57Th5; Tue, 9 Jan 2024 13:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T8WyM5g8wz51T4; Tue, 9 Jan 2024 13:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704807019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uNcywDGOJElVWHNsNbA40ZclSpMRg0UDqxB3I2lOvq8=; b=IVak+dOx+p62nIkFu0+SMYtzzABt1MqvPQQ2SOh9Gfs2bOmhKvD3zq8KRAH1WxQEIBGgA6 hQrj41s0loiu+qm71F0fOtZ3iHayF0k3t0d3gwOCljDhA7XitA8NgZ7ZLdRCHolxSr71NO 018Fuif7hHDbMIu5b4mN7CVdk7X8BCT8Q7YLULbU0NFHuj9RQ8U2OTFIf0efGiwOdVALvo o+mcxT38vUAjQkn5HPUnjbz5B5bZnF7BRRdiwN31xPYdp2/TkcQzaZ+aXfkAybmID+c8Ef 2SbpQDt59Kas9jqmvlPASFoFaCXuMp4WFX/xkJac4lDl6HXaslf6LJf3RQMplA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704807019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uNcywDGOJElVWHNsNbA40ZclSpMRg0UDqxB3I2lOvq8=; b=vTFNPmo/ffw4+jTB6tHEYW0cYbJevpeD/8jbZriUMh+VW9r8u5q1MgqgMVj/ar77Dx9C2s PMuXTwJ4s5Q4LV5nTjboc3C3ERq0KKiJNZdbC4JsYHoKW0thORo40GYetUmnEy6gMnpCzS v+MKTGP6vcbqmzUC7sNkhXler087ygDNZHQEWWJhMRVvChZrFVS0obE+4skoN+UuC5HrE3 9kQ3Ku/LqzDVndS+8ctTopczSnS7hBuH8t1IOQK6x1B81nOLrEp4zozRMYAkl6Ia4nW/AF 2UtG2Ct/LdzX6rDhVNrGRphQejRNMydMjpocvQc15sohoSrma58hdYVpjPwpIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704807019; a=rsa-sha256; cv=none; b=rUp+DUkU4krME5pN9ZuXh8Px5sKrZXjl5csizp3XyqEvQoJ1yMbIYhxH9pKutrMgm1UOul zqnayf6FgNwQNrsDpU0SaQXSbNOnCO2I3l6B33SFfShVAOGPqk7A/fuMyoCma3wZ52wOOr xYZPnjgBZpD7d0lSPhojfYiaZKBf6/a1nqoN8ielU6LicYXYrxS06+GOdHkkId3VS0aXxs r+jsyNSZ4ocHRhm1vsyJZfOERgiqMrAxYO/nPSczmluyW2NAE3iqWWEoitlLyEDZRNcQY3 o86LoZqAZG1aPQdPpo6RUSQ6M6P4AcgXiowVvif5FaYcYZh1TTo78HanbAKOAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T8WyM4l2vzsfr; Tue, 9 Jan 2024 13:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 409DUJ8V035796; Tue, 9 Jan 2024 13:30:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 409DUJXu035793; Tue, 9 Jan 2024 13:30:19 GMT (envelope-from git) Date: Tue, 9 Jan 2024 13:30:19 GMT Message-Id: <202401091330.409DUJXu035793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 15bb0300eeca - main - libhtr: pthread_attr_setaffinity_np(): Replace calloc() with malloc() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 15bb0300eeca233827a6a13cd2ed883e0034979d Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=15bb0300eeca233827a6a13cd2ed883e0034979d commit 15bb0300eeca233827a6a13cd2ed883e0034979d Author: Olivier Certner AuthorDate: 2024-01-04 15:20:50 +0000 Commit: Olivier Certner CommitDate: 2024-01-09 13:29:26 +0000 libhtr: pthread_attr_setaffinity_np(): Replace calloc() with malloc() Using calloc() instead of malloc() is useless here since the allocated memory is to be wholly crushed by the memcpy() call that follows. Suggested by: kib Reviewed by: emaste, kib Approved by: emaste (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43328 --- lib/libthr/thread/thr_attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_attr.c b/lib/libthr/thread/thr_attr.c index bbb143da1a7d..561037fa5eb4 100644 --- a/lib/libthr/thread/thr_attr.c +++ b/lib/libthr/thread/thr_attr.c @@ -551,7 +551,7 @@ _pthread_attr_setaffinity_np(pthread_attr_t *pattr, size_t cpusetsize, return (EINVAL); } if (attr->cpuset == NULL) { - attr->cpuset = calloc(1, kern_size); + attr->cpuset = malloc(kern_size); if (attr->cpuset == NULL) return (errno); attr->cpusetsize = kern_size;