From nobody Fri Mar 11 09:42:56 2022 X-Original-To: dev-commits-src-main@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 656E91A081D1; Fri, 11 Mar 2022 09:42:57 +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 4KFLZn2DCgz4X8T; Fri, 11 Mar 2022 09:42:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646991777; 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=0AITM8hFNIW5I9iRosc5NpsZ0JSDDOGtYM3P5KVjv4o=; b=dgIQj8pmSJTnTcBnSXqXJMZHHbEb+Kz6BVTtcR9Gk3rkV96D4FKv4m3GoIOfovjX1Tg4R7 7DsDnmTm6m8Eo8pUsM5SdeOkJ7pmAln0pm3zCo3fhU/NmZjojSFzzMusJJdFaz7V5niGnt Y6lho2oUgT8Xfa0LKsgKtOcWTqcu9QhX5ksc/fDjB+J1tPFjlczhKnN9o1KNfpa1mpBYsU NoVEK/ki4BiDcPCQkRsaJycpV7ARicwsKwUys8ZVLrz0We/dmEm8MxcyA+2ZcVGREy8Dy/ 4To0gy4nmWy1t0ArQjkjJWg/n/jZMJcgTA/fDhpphM4rJT/sNbgd5FLuQv1hmg== 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 2A9BC1702D; Fri, 11 Mar 2022 09:42:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22B9gv2E032464; Fri, 11 Mar 2022 09:42:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22B9guNt032463; Fri, 11 Mar 2022 09:42:56 GMT (envelope-from git) Date: Fri, 11 Mar 2022 09:42:56 GMT Message-Id: <202203110942.22B9guNt032463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 419822b372f5 - main - libgeom(3): Use calloc instead of malloc and bzero. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 419822b372f543b22d7fb04eae0dffacf058feb6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646991777; 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=0AITM8hFNIW5I9iRosc5NpsZ0JSDDOGtYM3P5KVjv4o=; b=VNBV4GmYuMeLzR/R1rpfxlnZ09I9uu1o1o+ETHWbnTcdsh286xH5ObBs4L9J4e5uzLTVxx 4fGnxtSe2TIgtNAa3/AJLlqkQT/EGJ8lfcZNGrNw1BFAlfER5FcxuhwZSz8QsJOEEVTkuE fHIxS0/1XtQUl1zCFX1yTkpm0V111i95J3QE0e2h+r+6xFdPbVmk7sU4yF4qfWFqLzwVin gX9eWhU84TlyoqWNFw9H2Vdpe8qutjmFtdJO7UIz7HyxcpPMqFRvtU9t7Q9H3dvciX83cd Fy8ry/MdVLAFfxWZ9QHEqWSLSkNzaqjC0AmOLvZ8QebELRwBgFvr27EQpm3fKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646991777; a=rsa-sha256; cv=none; b=TusCLx8hxEJVTBdM15+JMp1CU3fpzuCyR4RKlfGEsVd9rYp/6W94NrDt2Z1VE97I5HYgNk dJwAJivBPD2Ng7n/DhlNcDUaAfgeq8mGvtpTvg081CMQ/qWqj0LgfCAlGAkqK/Ng+QdwVm JgYAlSPPLrCB1EIZRQBPnXsqkC4M4gsAlAs0xb9YAfZqdt+fY4OWurJeFMbWq8kn/zR9QR CaE22C5c0Oi9dK+SBXHLrnLQVfSciII0l7GyGEZdok0U5VSGjSlTMWYT5ljuy6B4VwwRG3 2KNh/mtD0X/N1F6FN+PX3+2SaZVMAulYyWciJWhzSeSjl1FuzJEYSb2+HrB7/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=419822b372f543b22d7fb04eae0dffacf058feb6 commit 419822b372f543b22d7fb04eae0dffacf058feb6 Author: Hans Petter Selasky AuthorDate: 2022-03-10 09:16:27 +0000 Commit: Hans Petter Selasky CommitDate: 2022-03-11 09:38:16 +0000 libgeom(3): Use calloc instead of malloc and bzero. Pull Request: https://github.com/freebsd/freebsd-src/pull/546 MFC after: 1 week Sponsored by: NVIDIA Networking --- lib/geom/virstor/geom_virstor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/geom/virstor/geom_virstor.c b/lib/geom/virstor/geom_virstor.c index 25ebdebbe7eb..bd8da7337a55 100644 --- a/lib/geom/virstor/geom_virstor.c +++ b/lib/geom/virstor/geom_virstor.c @@ -406,10 +406,9 @@ virstor_label(struct gctl_req *req) } else strlcpy(md.provider, name, sizeof(md.provider)); } - sect = malloc(ssize); + sect = calloc(ssize, sizeof(unsigned char)); if (sect == NULL) err(1, "Cannot allocate sector of %zu bytes", ssize); - bzero(sect, ssize); virstor_metadata_encode(&md, sect); error = g_metadata_store(name, sect, ssize); free(sect);