Skip to content

Commit 4e6c78d

Browse files
hreineckemartinkpetersen
authored andcommitted
scsi: aacraid: do not overwrite retval in aac_reset_adapter()
'retval' got assigned a value twice, causing the original value to be lost. Link: https://lore.kernel.org/r/[email protected] Fixes: 3d3ca53 ("scsi: aacraid: use scsi_host_(block,unblock) to block I/O") Reported-by: Martin K. Petersen <[email protected]> Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 72655c0 commit 4e6c78d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/scsi/aacraid/commsup.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,7 +1626,7 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
16261626
int aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
16271627
{
16281628
unsigned long flagv = 0;
1629-
int retval;
1629+
int retval, unblock_retval;
16301630
struct Scsi_Host *host = aac->scsi_host_ptr;
16311631
int bled;
16321632

@@ -1656,8 +1656,9 @@ int aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
16561656
retval = _aac_reset_adapter(aac, bled, reset_type);
16571657
spin_unlock_irqrestore(host->host_lock, flagv);
16581658

1659-
retval = scsi_host_unblock(host, SDEV_RUNNING);
1660-
1659+
unblock_retval = scsi_host_unblock(host, SDEV_RUNNING);
1660+
if (!retval)
1661+
retval = unblock_retval;
16611662
if ((forced < 2) && (retval == -ENODEV)) {
16621663
/* Unwind aac_send_shutdown() IOP_RESET unsupported/disabled */
16631664
struct fib * fibctx = aac_fib_alloc(aac);

0 commit comments

Comments
 (0)