* [PATCH] mpt2sas: Fix memset using sizeof(ptr) not sizeof(*ptr)
@ 2011-05-09 6:11 Joe Perches
0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2011-05-09 6:11 UTC (permalink / raw)
To: James E.J. Bottomley; +Cc: LKML, linux-scsi
Found via coccinelle script
@@
type T;
T* ptr;
expression E1;
@@
* memset(E1, 0, sizeof(ptr));
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/scsi/mpt2sas/mpt2sas_transport.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c
index cb1cdec..9e86708 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_transport.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c
@@ -163,7 +163,7 @@ _transport_set_identify(struct MPT2SAS_ADAPTER *ioc, u16 handle,
return -EIO;
}
- memset(identify, 0, sizeof(identify));
+ memset(identify, 0, sizeof(*identify));
device_info = le32_to_cpu(sas_device_pg0.DeviceInfo);
/* sas_address */
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-09 6:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-09 6:11 [PATCH] mpt2sas: Fix memset using sizeof(ptr) not sizeof(*ptr) Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox