[ 3.5.y.z extended stable ] Patch "[SCSI] Fix incorrect memset in bnx2fc_parse_fcp_rsp" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Thu Jul 25 14:41:39 UTC 2013
This is a note to let you know that I have just added a patch titled
[SCSI] Fix incorrect memset in bnx2fc_parse_fcp_rsp
to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From b66feac7be56494d73826e9302d7fff877afb860 Mon Sep 17 00:00:00 2001
From: Andi Kleen <andi at firstfloor.org>
Date: Mon, 3 Sep 2012 20:50:30 +0200
Subject: [PATCH] [SCSI] Fix incorrect memset in bnx2fc_parse_fcp_rsp
commit 16da05b1158d1bcb31656e636a8736a663b1cf1f upstream.
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 at linux.intel.com>
Acked-by: Bhanu Prakash Gollapudi <bprakash at broadcom.com>
Signed-off-by: James Bottomley <JBottomley at Parallels.com>
Cc: Ben Hutchings <ben at decadent.org.uk>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/scsi/bnx2fc/bnx2fc_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 4f7453b..557cfd3 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1814,7 +1814,7 @@ static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
fcp_sns_len = SCSI_SENSE_BUFFERSIZE;
}
- memset(sc_cmd->sense_buffer, 0, sizeof(sc_cmd->sense_buffer));
+ memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
if (fcp_sns_len)
memcpy(sc_cmd->sense_buffer, rq_data, fcp_sns_len);
--
1.8.1.2
More information about the kernel-team
mailing list