[PATCH 6/8] Removed unnecessary memset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



zeroing memory with memset at "buf" position is useless because
g_try_malloc0 zeroes it also. Actually parameter sizeof(buf) is
wrong too (only 8 bytes cause it is a pointer).
---
 plugins/mgmtops.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index 3cdb97e..79a898f 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -1877,8 +1877,6 @@ static int mgmt_load_keys(int index, GSList *keys, gboolean debug_keys)
 	if (buf == NULL)
 		return -ENOMEM;
 
-	memset(buf, 0, sizeof(buf));
-
 	hdr = (void *) buf;
 	hdr->opcode = htobs(MGMT_OP_LOAD_KEYS);
 	hdr->len = htobs(cp_size);
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux