diff mbox series

[v2] scsi: aacraid: add missing manage_lock on management_fib_count

Message ID 20220225213308.89883-1-niels.dossche@ugent.be
State Superseded
Headers show
Series [v2] scsi: aacraid: add missing manage_lock on management_fib_count | expand

Commit Message

Niels Dossche Feb. 25, 2022, 9:33 p.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>
Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
---
Changes in v2:
  - Fix whitespace.

 drivers/scsi/aacraid/src.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bart Van Assche Feb. 26, 2022, 4:52 a.m. UTC | #1
On 2/25/22 13:33, Niels Dossche wrote:
> 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>
> Signed-off-by: Niels Dossche <dossche.niels@gmail.com>

One Signed-off-by line per author please. If you want to make sure that
multiple email addresses are recognized as a single author, please add
an entry to the .mailmap file.

Thanks,

Bart.
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,