]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: bnx2fc: Fix check in SCSI completion handler for timed out request
authorChad Dupuis <chad.dupuis@cavium.com>
Wed, 24 Jan 2018 16:07:06 +0000 (08:07 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:29:07 +0000 (12:29 +0200)
BugLink: http://bugs.launchpad.net/bugs/1783418
[ Upstream commit ecf7ff49945f5741fa1da112f994939f942031d3 ]

When a request times out we set the io_req flag BNX2FC_FLAG_IO_COMPL so
that if a subsequent completion comes in on that task ID we will ignore
it.  The issue is that in the check for this flag there is a missing
return so we will continue to process a request which may have already
been returned to the ownership of the SCSI layer.  This can cause
unpredictable results.

Solution is to add in the missing return.

[mkp: typo plus title shortening]

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/scsi/bnx2fc/bnx2fc_io.c

index 8e2f767147cb43de2acdcabeab820537fc3422d3..5a645b8b9af170d66a2abd510393c5f5c5725aa8 100644 (file)
@@ -1889,6 +1889,7 @@ void bnx2fc_process_scsi_cmd_compl(struct bnx2fc_cmd *io_req,
                /* we will not receive ABTS response for this IO */
                BNX2FC_IO_DBG(io_req, "Timer context finished processing "
                           "this scsi cmd\n");
+               return;
        }
 
        /* Cancel the timeout_work, as we received IO completion */