diff mbox

mmc: check correct variable after kzalloc()

Message ID 20130212122454.GC19045@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Feb. 12, 2013, 12:24 p.m. UTC
There is a typo here so we check "mqrq_cur->packed" instead of
"mqrq_prev->packed".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

Comments

Chris Ball Feb. 12, 2013, 12:27 p.m. UTC | #1
Hi Dan,

On Tue, Feb 12 2013, Dan Carpenter wrote:
> There is a typo here so we check "mqrq_cur->packed" instead of
> "mqrq_prev->packed".
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index c0d1315..97a848b 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -378,7 +378,7 @@ int mmc_packed_init(struct mmc_queue *mq, struct mmc_card *card)
>  	}
>  
>  	mqrq_prev->packed = kzalloc(sizeof(struct mmc_packed), GFP_KERNEL);
> -	if (!mqrq_cur->packed) {
> +	if (!mqrq_prev->packed) {
>  		pr_warn("%s: unable to allocate packed cmd for mqrq_prev\n",
>  			   mmc_card_name(card));
>  		kfree(mqrq_cur->packed);
>

Thanks, this is already fixed via a rebase edit to to the original patch
in mmc-next.  (Fengguang's 0-day bot caught it.)

- Chris.
Dan Carpenter Feb. 12, 2013, 12:35 p.m. UTC | #2
On Tue, Feb 12, 2013 at 07:27:26AM -0500, Chris Ball wrote:
> Hi Dan,
> 
> On Tue, Feb 12 2013, Dan Carpenter wrote:
> > There is a typo here so we check "mqrq_cur->packed" instead of
> > "mqrq_prev->packed".
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> > index c0d1315..97a848b 100644
> > --- a/drivers/mmc/card/queue.c
> > +++ b/drivers/mmc/card/queue.c
> > @@ -378,7 +378,7 @@ int mmc_packed_init(struct mmc_queue *mq, struct mmc_card *card)
> >  	}
> >  
> >  	mqrq_prev->packed = kzalloc(sizeof(struct mmc_packed), GFP_KERNEL);
> > -	if (!mqrq_cur->packed) {
> > +	if (!mqrq_prev->packed) {
> >  		pr_warn("%s: unable to allocate packed cmd for mqrq_prev\n",
> >  			   mmc_card_name(card));
> >  		kfree(mqrq_cur->packed);
> >
> 
> Thanks, this is already fixed via a rebase edit to to the original patch
> in mmc-next.  (Fengguang's 0-day bot caught it.)
> 

Ah, grand.  We try to avoid duplicates but there is a gap in our
system...

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

Patch

diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index c0d1315..97a848b 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -378,7 +378,7 @@  int mmc_packed_init(struct mmc_queue *mq, struct mmc_card *card)
 	}
 
 	mqrq_prev->packed = kzalloc(sizeof(struct mmc_packed), GFP_KERNEL);
-	if (!mqrq_cur->packed) {
+	if (!mqrq_prev->packed) {
 		pr_warn("%s: unable to allocate packed cmd for mqrq_prev\n",
 			   mmc_card_name(card));
 		kfree(mqrq_cur->packed);