[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFpvCFCB5VwaRUvq7X0bkEsxUDQ9GsnbCMSi7MOrAXhgFg@mail.gmail.com>
Date: Tue, 21 Jul 2015 12:54:02 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Nicholas Krause <xerofoify@...il.com>
Cc: Jens Axboe <axboe@...com>, Mike Snitzer <snitzer@...hat.com>,
Yunpeng Gao <yunpeng.gao@...el.com>,
Fabian Frederick <fabf@...net.be>,
Joe Perches <joe@...ches.com>,
Bhuvanesh <bhuvanesh_surachari@...tor.com>,
"Dong, Chuanxiao" <chuanxiao.dong@...el.com>,
Rabin Vincent <rabin.vincent@...s.com>,
linux-mmc <linux-mmc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mmc:Fix refcount leak in the function mmc_queue_resume
for the semaphone thread_sem
On 7 July 2015 at 16:10, Nicholas Krause <xerofoify@...il.com> 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@...il.com>
> ---
> 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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists