diff mbox series

scsi: aacraid: add missing manage_lock on management_fib_count

Message ID 14d6e454-49c3-0a85-68f1-3f003ad032e6@ugent.be
State New
Headers show
Series scsi: aacraid: add missing manage_lock on management_fib_count | expand

Commit Message

Niels Dossche Feb. 21, 2022, 12:03 a.m. UTC
All other places modify the management_fib_count under the manage_lock.
Avoid a possible race condition by also applying that lock in
aac_src_intr_message.

Signed-off-by: Niels Dossche <niels.dossche@ugent.be>
---
 drivers/scsi/aacraid/src.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
index 11ef58204e96..ca73439587ed 100644
--- a/drivers/scsi/aacraid/src.c
+++ b/drivers/scsi/aacraid/src.c
@@ -91,7 +91,9 @@  static irqreturn_t aac_src_intr_message(int irq, void *dev_id)
                                        dev->sync_fib);
                        spin_lock_irqsave(&dev->sync_fib->event_lock, sflags);
                        if (dev->sync_fib->flags & FIB_CONTEXT_FLAG_WAIT) {
+                               spin_lock(&dev->manage_lock);
                                dev->management_fib_count--;
+                               spin_unlock(&dev->manage_lock);
                                complete(&dev->sync_fib->event_wait);
                        }
                        spin_unlock_irqrestore(&dev->sync_fib->event_lock,