Skip to contentSkip to conversation

mmc: check correct variable after kzalloc()

PATCH In review Dan Carpenter 2 participants 3 messages Feb 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: check correct variable after kzalloc()

There is a typo here so we check "mqrq_cur->packed" instead of "mqrq_prev->packed".

drivers/mmc/card/queue.c +1 -1
index c0d1315..97a848b 100644
@@ -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);
#1 lore raw

Hi Dan,

Quoted 11 lines · Dan Carpenter

There is a typo here so we check "mqrq_cur->packed" instead of "mqrq_prev->packed".

drivers/mmc/card/queue.c +0 -0
index c0d1315..97a848b 100644

drivers/mmc/card/queue.c int mmc_packed_init(struct mmc_queue *mq, struct mmc_card *card) · line 384

Quoted 8 lines
drivers/mmc/card/queue.c +1 -1
@@ -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.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#2 lore raw
Quoted 15 lines · Chris Ball

Hi Dan,

Quoted 12 lines · Dan Carpenter

There is a typo here so we check "mqrq_cur->packed" instead of "mqrq_prev->packed".

drivers/mmc/card/queue.c +0 -0
index c0d1315..97a848b 100644
@@ -378,7 +378,7 @@ int mmc_packed_init(struct mmc_queue *mq, struct mmc_card *card)
 	}
 
Quoted 11 lines

drivers/mmc/card/queue.c int mmc_packed_init(struct mmc_queue *mq, struct mmc_card *card) · line 384

Quoted 7 lines
drivers/mmc/card/queue.c +1 -1
 	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