summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-14 21:35:52 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-14 21:35:52 -0700
commit2951157f054039fa4f19b4c05fbf206b7f9d2eec (patch)
tree3d7d862521237e2283bb8629d2816c01865a7252
parentd791d413fd8527aa6b130882cc84d52aee0fe980 (diff)
parent6e3b2bbb197eb12b2bef35bcf2ac3bd6a5facab2 (diff)
downloadlinux-2951157f054039fa4f19b4c05fbf206b7f9d2eec.tar.gz
linux-2951157f054039fa4f19b4c05fbf206b7f9d2eec.tar.bz2
linux-2951157f054039fa4f19b4c05fbf206b7f9d2eec.zip
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: [SCSI] 3w-xxxx: fix oops caused by incorrect REQUEST_SENSE handling
-rw-r--r--drivers/scsi/3w-xxxx.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index bf5d63e1beee..656bdb1352d8 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -1864,10 +1864,17 @@ static int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id)
/* This function will handle the request sense scsi command */
static int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id)
{
+ char request_buffer[18];
+
dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_request_sense()\n");
- /* For now we just zero the request buffer */
- memset(tw_dev->srb[request_id]->request_buffer, 0, tw_dev->srb[request_id]->request_bufflen);
+ memset(request_buffer, 0, sizeof(request_buffer));
+ request_buffer[0] = 0x70; /* Immediate fixed format */
+ request_buffer[7] = 10; /* minimum size per SPC: 18 bytes */
+ /* leave all other fields zero, giving effectively NO_SENSE return */
+ tw_transfer_internal(tw_dev, request_id, request_buffer,
+ sizeof(request_buffer));
+
tw_dev->state[request_id] = TW_S_COMPLETED;
tw_state_request_finish(tw_dev, request_id);