Skip to content

Commit

Permalink
scsi: ses: Fix wrong page error
Browse files Browse the repository at this point in the history
If a SES device returns an error on a requested diagnostic page, we are
currently printing an error indicating the wrong page was received. Fix
this up to simply return a failure and only check the returned page when
the diagnostic page buffer was populated by the device.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Brian King authored and Martin K. Petersen committed Aug 8, 2017
1 parent b0e17a9 commit 424f727
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/ses.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code,

ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen,
NULL, SES_TIMEOUT, SES_RETRIES, NULL);
if (unlikely(!ret))
if (unlikely(ret))
return ret;

recv_page_code = ((unsigned char *)buf)[0];
Expand Down

0 comments on commit 424f727

Please sign in to comment.