Commit 2951157f authored by Linus Torvalds's avatar Linus Torvalds

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
parents d791d413 6e3b2bbb
...@@ -1864,10 +1864,17 @@ static int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id) ...@@ -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 */ /* This function will handle the request sense scsi command */
static int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id) 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"); dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_request_sense()\n");
/* For now we just zero the request buffer */ memset(request_buffer, 0, sizeof(request_buffer));
memset(tw_dev->srb[request_id]->request_buffer, 0, tw_dev->srb[request_id]->request_bufflen); 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_dev->state[request_id] = TW_S_COMPLETED;
tw_state_request_finish(tw_dev, request_id); tw_state_request_finish(tw_dev, request_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment