Re: [PATCH] mmc:Fix refcount leak in the function mmc_queue_resume for the semaphone thread_sem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7 July 2015 at 16:10, Nicholas Krause <xerofoify@xxxxxxxxx> wrote:
> This fixes the unneeded possible freeing of the semaphone lock
> thread_sem as part of the passed mmc_queue structure pointer
> mq to the function mmc_queue_resume by 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?

>
> Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
> ---
>  drivers/mmc/card/queue.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index b5a2b14..97a80f6 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -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. :-)

>                 spin_lock_irqsave(q->queue_lock, flags);
>                 blk_start_queue(q);
>                 spin_unlock_irqrestore(q->queue_lock, flags);
> --
> 2.1.4
>

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux