scsi: mpt3sas: Fix use-after-free warning
authorSreekanth Reddy <sreekanth.reddy@broadcom.com>
Tue, 6 Sep 2022 13:49:08 +0000 (19:19 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 10:39:46 +0000 (12:39 +0200)
commitb8fc9e91b931215110ba824d1a2983c5f60b6f82
tree7343266f60c1173ee4c3292a545d528ec16a308e
parentb970518014f2f0f6c493fb86c1e092b936899061
scsi: mpt3sas: Fix use-after-free warning

commit 991df3dd5144f2e6b1c38b8d20ed3d4d21e20b34 upstream.

Fix the following use-after-free warning which is observed during
controller reset:

refcount_t: underflow; use-after-free.
WARNING: CPU: 23 PID: 5399 at lib/refcount.c:28 refcount_warn_saturate+0xa6/0xf0

Link: https://lore.kernel.org/r/20220906134908.1039-2-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/mpt3sas/mpt3sas_scsih.c