lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri,  3 Feb 2012 19:20:19 +0530
From:	amit.sahrawat83@...il.com
To:	Alexander Viro <viro@...iv.linux.org.uk>
Cc:	Amit Sahrawat <a.sahrawat@...sung.com>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Amit Sahrawat <amit.sahrawat83@...il.com>
Subject: [PATCH 3/3] bio-integrity: use kmem_cache_zalloc in bio_integrity_alloc_bioset()

From: Amit Sahrawat <amit.sahrawat83@...il.com>

Use advantage of kmem_cache_zalloc() to remove memset() call in
bio_integrity_alloc_bioset()

Signed-off-by: Amit Sahrawat <a.sahrawat@...sung.com>
---
 fs/bio-integrity.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index c2183f3..836e34b 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -93,7 +93,7 @@ struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *bio,
 
 	/* Lower order allocations come straight from slab */
 	if (!use_bip_pool(idx))
-		bip = kmem_cache_alloc(bip_slab[idx].slab, gfp_mask);
+		bip = kmem_cache_zalloc(bip_slab[idx].slab, gfp_mask);
 
 	/* Use mempool if lower order alloc failed or max vecs were requested */
 	if (bip == NULL) {
@@ -106,8 +106,6 @@ struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *bio,
 		}
 	}
 
-	memset(bip, 0, sizeof(*bip));
-
 	bip->bip_slab = idx;
 	bip->bip_bio = bio;
 	bio->bi_integrity = bip;
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ