summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qedf
diff options
context:
space:
mode:
authorSaurav Kashyap <skashyap@marvell.com>2019-08-23 02:52:40 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2019-08-29 18:51:19 -0400
commit0482262646e4e9e089c4e75f336244c5eaf360e1 (patch)
tree368f4cb1503a1989637bf41c53afd0d4b08b676d /drivers/scsi/qedf
parentb29a907f105cc659a303bb2657959c7d0d188620 (diff)
downloadlinux-0482262646e4e9e089c4e75f336244c5eaf360e1.tar.bz2
scsi: qedf: Check for module unloading bit before processing link update AEN
Prevent race where we're removing the module and we get link update Signed-off-by: Saurav Kashyap <skashyap@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedf')
-rw-r--r--drivers/scsi/qedf/qedf_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 50b1fa8740da..ab9a932089ae 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -533,6 +533,16 @@ static void qedf_link_update(void *dev, struct qed_link_output *link)
{
struct qedf_ctx *qedf = (struct qedf_ctx *)dev;
+ /*
+ * Prevent race where we're removing the module and we get link update
+ * for qed.
+ */
+ if (test_bit(QEDF_UNLOADING, &qedf->flags)) {
+ QEDF_ERR(&qedf->dbg_ctx,
+ "Ignore link update, driver getting unload.\n");
+ return;
+ }
+
if (link->link_up) {
if (atomic_read(&qedf->link_state) == QEDF_LINK_UP) {
QEDF_INFO((&qedf->dbg_ctx), QEDF_LOG_DISC,