[PATCH] SCSI, SAS, MPT: memset all of struct sas_identify, not just size of a pointer bytes

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

 



I have a hard time believing that the intention of this code in 
drivers/scsi/mpt2sas/mpt2sas_transport.c
    static int
    _transport_set_identify(struct MPT2SAS_ADAPTER *ioc, u16 handle,
        struct sas_identify *identify)
    {
    ...
    	memset(identify, 0, sizeof(identify));
    ...
really is to just memset() the first few bytes (size of the pointer) of 
the struct.

I believe what is intended is to memset() the entire struct.

Signed-off-by: Jesper Juhl <jj@xxxxxxxxxxxxx>
---
 mpt2sas_transport.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

  compile tested only

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 */


-- 
Jesper Juhl <jj@xxxxxxxxxxxxx>            http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux