lkml.org 
[lkml]   [2011]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] mpt2sas: Fix memset using sizeof(ptr) not sizeof(*ptr)
    From
    Date
    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 */



    \
     
     \ /
      Last update: 2011-05-09 08:15    [W:0.020 / U:0.736 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site