aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/st.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 322ca87d252e..1951fb4ed404 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -2371,7 +2371,8 @@ static int st_set_options(struct scsi_tape *STp, long options)
2371static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs) 2371static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs)
2372{ 2372{
2373 unsigned char cmd[MAX_COMMAND_SIZE]; 2373 unsigned char cmd[MAX_COMMAND_SIZE];
2374 struct st_request *SRpnt = NULL; 2374 struct st_request *SRpnt;
2375 int ret;
2375 2376
2376 memset(cmd, 0, MAX_COMMAND_SIZE); 2377 memset(cmd, 0, MAX_COMMAND_SIZE);
2377 cmd[0] = MODE_SENSE; 2378 cmd[0] = MODE_SENSE;
@@ -2380,14 +2381,17 @@ static int read_mode_page(struct scsi_tape *STp, int page, int omit_block_descs)
2380 cmd[2] = page; 2381 cmd[2] = page;
2381 cmd[4] = 255; 2382 cmd[4] = 255;
2382 2383
2383 SRpnt = st_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_FROM_DEVICE, 2384 SRpnt = st_allocate_request(STp);
2384 STp->device->request_queue->rq_timeout, 0, 1); 2385 if (!SRpnt)
2385 if (SRpnt == NULL) 2386 return STp->buffer->syscall_result;
2386 return (STp->buffer)->syscall_result;
2387 2387
2388 ret = st_scsi_kern_execute(SRpnt, cmd, DMA_FROM_DEVICE,
2389 STp->buffer->b_data, cmd[4],
2390 STp->device->request_queue->rq_timeout,
2391 MAX_RETRIES);
2388 st_release_request(SRpnt); 2392 st_release_request(SRpnt);
2389 2393
2390 return (STp->buffer)->syscall_result; 2394 return ret ? : STp->buffer->syscall_result;
2391} 2395}
2392 2396
2393 2397