diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-15 00:35:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-15 00:35:52 -0400 |
commit | 2951157f054039fa4f19b4c05fbf206b7f9d2eec (patch) | |
tree | 3d7d862521237e2283bb8629d2816c01865a7252 | |
parent | d791d413fd8527aa6b130882cc84d52aee0fe980 (diff) | |
parent | 6e3b2bbb197eb12b2bef35bcf2ac3bd6a5facab2 (diff) |
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.c | 11 |
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) | |||
1864 | /* This function will handle the request sense scsi command */ | 1864 | /* This function will handle the request sense scsi command */ |
1865 | static int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id) | 1865 | static int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id) |
1866 | { | 1866 | { |
1867 | char request_buffer[18]; | ||
1868 | |||
1867 | dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_request_sense()\n"); | 1869 | dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_request_sense()\n"); |
1868 | 1870 | ||
1869 | /* For now we just zero the request buffer */ | 1871 | memset(request_buffer, 0, sizeof(request_buffer)); |
1870 | memset(tw_dev->srb[request_id]->request_buffer, 0, tw_dev->srb[request_id]->request_bufflen); | 1872 | request_buffer[0] = 0x70; /* Immediate fixed format */ |
1873 | request_buffer[7] = 10; /* minimum size per SPC: 18 bytes */ | ||
1874 | /* leave all other fields zero, giving effectively NO_SENSE return */ | ||
1875 | tw_transfer_internal(tw_dev, request_id, request_buffer, | ||
1876 | sizeof(request_buffer)); | ||
1877 | |||
1871 | tw_dev->state[request_id] = TW_S_COMPLETED; | 1878 | tw_dev->state[request_id] = TW_S_COMPLETED; |
1872 | tw_state_request_finish(tw_dev, request_id); | 1879 | tw_state_request_finish(tw_dev, request_id); |
1873 | 1880 | ||