]> git.karo-electronics.de Git - karo-tx-linux.git/commit
[SCSI] Fix incorrect memset in bnx2fc_parse_fcp_rsp
authorAndi Kleen <andi@firstfloor.org>
Mon, 3 Sep 2012 18:50:30 +0000 (20:50 +0200)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 18 Sep 2012 09:42:12 +0000 (10:42 +0100)
commitd9e227b7d20d8d42efa5a640387fdc0d8cfb1945
treee952e2eea59ac65ea84d43fb03b16a7208ac052f
parent62d3287ea697f1fb745b98969b9f58f2c9729dc0
[SCSI] Fix incorrect memset in bnx2fc_parse_fcp_rsp

gcc 4.8 warns because the memset only clears sizeof(char *) bytes, not
the whole buffer. Use the correct buffer size and clear the whole sense
buffer.

/backup/lsrc/git/linux-lto-2.6/drivers/scsi/bnx2fc/bnx2fc_io.c: In
function 'bnx2fc_parse_fcp_rsp':
/backup/lsrc/git/linux-lto-2.6/drivers/scsi/bnx2fc/bnx2fc_io.c:1810:41:
warning: argument to 'sizeof' in 'memset' call is the same expression as
the destination; did you mean to provide an explicit length?
[-Wsizeof-pointer-memaccess]
   memset(sc_cmd->sense_buffer, 0, sizeof(sc_cmd->sense_buffer));
                                         ^

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/bnx2fc/bnx2fc_io.c