Skip to contentSkip to conversation

cifs: replaced kmalloc + memset with kzalloc

PATCH Applied Dia Vasile 2 participants 2 messages Mar 10, 2013 – Mar 25, 2013

Subsystems (2)
lore
Share & tools
lore

Dia Vasile

author
#0 lore raw

PATCH 1/1 cifs: replaced kmalloc + memset with kzalloc

From: Dia Vasile <[email protected]>

---
 fs/cifs/smb2pdu.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/cifs/smb2pdu.c +1 -3
index 41d9d07..83ef66e 100644
@@ -846,12 +846,10 @@ create_lease_buf(u8 *lease_key, u8 oplock)
 {
 	struct create_lease *buf;
 
-	buf = kmalloc(sizeof(struct create_lease), GFP_KERNEL);
+	buf = kzalloc(sizeof(struct create_lease), GFP_KERNEL);
 	if (!buf)
 		return NULL;
 
-	memset(buf, 0, sizeof(struct create_lease));
-
 	buf->lcontext.LeaseKeyLow = cpu_to_le64(*((u64 *)lease_key));
 	buf->lcontext.LeaseKeyHigh = cpu_to_le64(*((u64 *)(lease_key + 8)));
 	if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE)
Signature · 1 line
1.7.10.4
Applied
#1 lore raw

Merged into cifs-2.6.git for-next branch

Quoted 28 lines · Dia Vasile

From: Dia Vasile <[email protected]>

---
 fs/cifs/smb2pdu.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/cifs/smb2pdu.c +1 -4
index 41d9d07..83ef66e 100644
@@ -846,12 +846,10 @@ create_lease_buf(u8 *lease_key, u8 oplock)
 {
        struct create_lease *buf;
 
-       buf = kmalloc(sizeof(struct create_lease), GFP_KERNEL);
+       buf = kzalloc(sizeof(struct create_lease), GFP_KERNEL);
        if (!buf)
                return NULL;
 
-       memset(buf, 0, sizeof(struct create_lease));
-
        buf->lcontext.LeaseKeyLow = cpu_to_le64(*((u64 *)lease_key));
        buf->lcontext.LeaseKeyHigh = cpu_to_le64(*((u64 *)(lease_key + 8)));
        if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE)
--

1.7.10.4

Signature · 3 lines
Thanks,

Steve