mmc:Fix refcount leak in the function mmc_queue_resume for the semaphone thread_sem
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Nicholas Krause
This fixes the unneeded possible freeing of the semaphone lock
thread_semas part of the passedmmc_queuestructure pointer mq to the functionmmc_queue_resumeby calling up on this lock now due to this lock's refcount never being incremented by the caller before the call to this particular function by means of the function down.
I guess you only looked at the code, but didn't actually notice any bug/hang?
Quoted 11 lines
Signed-off-by Nicholas Krause <[email protected]>--- drivers/mmc/card/queue.c | 2 -- 1 file changed, 2 deletions(-)drivers/mmc/card/queue.c +0
-0
drivers/mmc/card/queue.c void mmc_queue_resume(struct mmc_queue *mq) · line 442
Quoted 5 lines
drivers/mmc/card/queue.c +0
-2@@ -438,8 +438,6 @@ void mmc_queue_resume(struct mmc_queue *mq)if (mq->flags &MMC_QUEUE_SUSPENDED ) { mq->flags &= ~MMC_QUEUE_SUSPENDED ; -up (&mq->thread_sem); -
This should be balanced from mmc_queue_suspend(), so it's likely a bad idea to remove "up()" here. :-)
Quoted 6 lines
drivers/mmc/card/queue.c +0
-1spin_lock_irqsave (q->queue_lock, flags);blk_start_queue (q);spin_unlock_irqrestore (q->queue_lock, flags); --2.1.4
Kind regards
Uffe