Skip to content

Commit dddbd23

Browse files
MrVanJassi Brar
authored andcommitted
mailbox: Not protect module_put with spin_lock_irqsave
&chan->lock is not supposed to protect 'chan->mbox'. And in __mbox_bind_client, try_module_get is also not protected by &chan->lock. So move module_put out of the lock protected region. Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent 8da4988 commit dddbd23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mailbox/mailbox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ void mbox_free_channel(struct mbox_chan *chan)
486486
if (chan->txdone_method == TXDONE_BY_ACK)
487487
chan->txdone_method = TXDONE_BY_POLL;
488488

489-
module_put(chan->mbox->dev->driver->owner);
490489
spin_unlock_irqrestore(&chan->lock, flags);
490+
module_put(chan->mbox->dev->driver->owner);
491491
}
492492
EXPORT_SYMBOL_GPL(mbox_free_channel);
493493

0 commit comments

Comments
 (0)