From nobody Fri Jan 26 21:05:10 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 4TM9FM2lcrz58qhd; Fri, 26 Jan 2024 21:05:11 +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 4TM9FM07Kdz4NlR; Fri, 26 Jan 2024 21:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706303111; 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=56E5W0vYAWuvmcOjQCmVpWECLyf3WOkdmUWA97vp6qY=; b=WYeWlNsnDD8+mXb1clUHokxxq8Mux63hZAfUscRZwgruGAaqXlAkUN6hn8/JyDwjvoFhY7 S9Ss2mEKCxp30I1Myt5L7zqN20HHoj7tS6BVzJriZLljAcwXdBtMh4kSFbPSGwAVMcRk7q HKeyJnYJ+pXQjzim5mjRULzCvk069gUONPt8ZBFCL7c45UuIweTWjjO2D0XZDOgc5mipB1 8J3tAjWzfLSMZ5lFzfVkY7G/WiFiluZrhBL8fCfqK2xOWAFfNGKRzo+s7+EehElpIe33uo aJ31Tk+H9VO5f5SMw5uwADtwk5yZJQc6uxR9ZASagjPgxM5YFx4ugRRCcwEinQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706303111; 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=56E5W0vYAWuvmcOjQCmVpWECLyf3WOkdmUWA97vp6qY=; b=JQffvVSa/avhPYoYDIAYFOzE3fy/m9Xxtyti9JDU1iDjSQjG2MOe4F9s7ZbY0Lr1Gw3f0y /f0OlLDc5EVXxqUM5ZP0tM17ayXyZXKfckWsRn7bj5x0SvMpHsyQo0yADSWunA1HOHnltt wOkzlNjlWjZ4gV85sD22GgdHKIGu8NESB7H1rrKjbJ3nnN85mHXstJZaz0wr4OJ3bFssiI 3Ss3xdZwImvkFKtAI0iz91imbf4oeGUycC51uGJ1NqqNVOERo0/dE2o8m9yexB/Jb5RNhW PW31y/+5mdhete55Jun9fc1erNYW+ENg3JouNOS++UGj5F+wb4baPIzZ7QAXDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706303111; a=rsa-sha256; cv=none; b=nsNjIwJpZzptONJKxe6xQo4vURYITl8OEld/FfQtxkte+/LYr8N4UeLvbR8ccr65VpwOEp 1vF4KUzdsukrc0SqvRQkpF7rchSa9UvfoOAU8y8aMB6mXydoWh55dPm7EWABZTMJj3Ngth OXoLGtFyzYJ3LH/DDU+VIldMerPkdZLVE1lVavb+w0CJX/kf3h/V/zLP4K4Bqkkt/aZRS2 mPq54lXvgx6WvtY72UValm+H3vZfvPvfLfc6iUGQEMdYYRzGSPjVNmbQw1oYEe/rMnikU6 2/DO590vQ26Ig68IxU0zBzY8ZNZ/3yDIGEe0oVNW/4A2QQC+NDu3CSA1l35RSQ== 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 4TM9FL6KX8zxFk; Fri, 26 Jan 2024 21:05:10 +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 40QL5AwE084416; Fri, 26 Jan 2024 21:05:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40QL5AiX084413; Fri, 26 Jan 2024 21:05:10 GMT (envelope-from git) Date: Fri, 26 Jan 2024 21:05:10 GMT Message-Id: <202401262105.40QL5AiX084413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 2c9ab16625d7 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c9ab16625d7129aae29270764e6e447a5c614fd Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2c9ab16625d7129aae29270764e6e447a5c614fd commit 2c9ab16625d7129aae29270764e6e447a5c614fd Author: Olivier Certner AuthorDate: 2024-01-04 15:20:50 +0000 Commit: Olivier Certner CommitDate: 2024-01-26 21:04:32 +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 (cherry picked from commit 15bb0300eeca233827a6a13cd2ed883e0034979d) Approved by: markj (mentor) --- 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;