[SCSI] 3w-xxxx: fix oops caused by incorrect REQUEST_SENSE handling

3w-xxxx emulates a REQUEST_SENSE response by simply returning nothing.
Unfortunately, it's assuming that the REQUEST_SENSE command is
implemented with use_sg == 0, which is no longer the case. The oops
occurs because it's clearing the scatterlist in request_buffer instead
of the memory region.

This is fixed by using tw_transfer_internal() to transfer correctly to
the scatterlist.

Acked-by: adam radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by James Bottomley and committed by James Bottomley 6e3b2bbb 8a065975

+9 -2
+9 -2
drivers/scsi/3w-xxxx.c
··· 1864 1864 /* This function will handle the request sense scsi command */ 1865 1865 static int tw_scsiop_request_sense(TW_Device_Extension *tw_dev, int request_id) 1866 1866 { 1867 + char request_buffer[18]; 1868 + 1867 1869 dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_request_sense()\n"); 1868 1870 1869 - /* For now we just zero the request buffer */ 1870 - memset(tw_dev->srb[request_id]->request_buffer, 0, tw_dev->srb[request_id]->request_bufflen); 1871 + memset(request_buffer, 0, sizeof(request_buffer)); 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 1878 tw_dev->state[request_id] = TW_S_COMPLETED; 1872 1879 tw_state_request_finish(tw_dev, request_id); 1873 1880