Skip to content

Commit

Permalink
scsi: fas216: Translate message to host byte status
Browse files Browse the repository at this point in the history
Instead of setting the message byte translate it to the appropriate host
byte. As error recovery would return DID_ERROR for any non-zero message
byte the translation doesn't change the error handling.

[mkp: zeroday bug report: s/SCpnt->result/SCpnt/]

Link: https://lore.kernel.org/r/20210427083046.31620-33-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Hannes Reinecke authored and Martin K. Petersen committed Jun 1, 2021
1 parent ac87ee0 commit 7f33f56
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/scsi/arm/fas216.c
Original file line number Diff line number Diff line change
@@ -2042,17 +2042,18 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)
{
info->stats.fins += 1;

SCpnt->result = result << 16 | info->scsi.SCp.Message << 8 |
info->scsi.SCp.Status;
set_host_byte(SCpnt, result);
if (result == DID_OK)
scsi_msg_to_host_byte(SCpnt, info->scsi.SCp.Message);
set_status_byte(SCpnt, info->scsi.SCp.Status);

fas216_log_command(info, LOG_CONNECT, SCpnt,
"command complete, result=0x%08x", SCpnt->result);

/*
* If the driver detected an error, we're all done.
*/
if (host_byte(SCpnt->result) != DID_OK ||
msg_byte(SCpnt->result) != COMMAND_COMPLETE)
if (get_host_byte(SCpnt) != DID_OK)
goto done;

/*

0 comments on commit 7f33f56

Please sign in to comment.