All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mmc: Avoid null pointer dereference
@ 2012-04-11 20:31 Philippe De Swert
  2012-04-12  1:45 ` Namjae Jeon
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe De Swert @ 2012-04-11 20:31 UTC (permalink / raw)
  To: philippedeswert, linux-mmc, linux-kernel, john.calixto, prakity, cjb

After the null check on md the code jumped to cmd_done, which then
will dereference md in mmc_blk_put. This patch avoids the possible
null pointer dereference in that case.

Signed-off-by: Philippe De Swert <philippedeswert@gmail.com>
---
 drivers/mmc/card/block.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index b180965..4bed186 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -384,7 +384,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
 	md = mmc_blk_get(bdev->bd_disk);
 	if (!md) {
 		err = -EINVAL;
-		goto cmd_done;
+		goto cmd_err;
 	}
 
 	card = md->queue.card;
@@ -483,6 +483,7 @@ cmd_rel_host:
 
 cmd_done:
 	mmc_blk_put(md);
+cmd_err:
 	kfree(idata->buf);
 	kfree(idata);
 	return err;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] mmc: Avoid null pointer dereference
  2012-04-11 20:31 [PATCH 1/2] mmc: Avoid null pointer dereference Philippe De Swert
@ 2012-04-12  1:45 ` Namjae Jeon
  2012-05-10  0:43   ` Namjae Jeon
  0 siblings, 1 reply; 4+ messages in thread
From: Namjae Jeon @ 2012-04-12  1:45 UTC (permalink / raw)
  To: Philippe De Swert, Chris Ball
  Cc: linux-mmc, linux-kernel, john.calixto, prakity

2012/4/12 Philippe De Swert <philippedeswert@gmail.com>:
> After the null check on md the code jumped to cmd_done, which then
> will dereference md in mmc_blk_put. This patch avoids the possible
> null pointer dereference in that case.
>
> Signed-off-by: Philippe De Swert <philippedeswert@gmail.com>
This patch is good also.
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] mmc: Avoid null pointer dereference
  2012-04-12  1:45 ` Namjae Jeon
@ 2012-05-10  0:43   ` Namjae Jeon
  2012-05-10  0:54     ` Chris Ball
  0 siblings, 1 reply; 4+ messages in thread
From: Namjae Jeon @ 2012-05-10  0:43 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, linux-kernel, Philippe De Swert

Hi. Chris.

Would you check this patch ?

Thanks.

2012/4/12, Namjae Jeon <linkinjeon@gmail.com>:
> 2012/4/12 Philippe De Swert <philippedeswert@gmail.com>:
>> After the null check on md the code jumped to cmd_done, which then
>> will dereference md in mmc_blk_put. This patch avoids the possible
>> null pointer dereference in that case.
>>
>> Signed-off-by: Philippe De Swert <philippedeswert@gmail.com>
> This patch is good also.
> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] mmc: Avoid null pointer dereference
  2012-05-10  0:43   ` Namjae Jeon
@ 2012-05-10  0:54     ` Chris Ball
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Ball @ 2012-05-10  0:54 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: linux-mmc, linux-kernel, Philippe De Swert

Hi,

On Wed, May 09 2012, Namjae Jeon wrote:
> Hi. Chris.
>
> Would you check this patch ?
>
> Thanks.
>
> 2012/4/12, Namjae Jeon <linkinjeon@gmail.com>:
>> 2012/4/12 Philippe De Swert <philippedeswert@gmail.com>:
>>> After the null check on md the code jumped to cmd_done, which then
>>> will dereference md in mmc_blk_put. This patch avoids the possible
>>> null pointer dereference in that case.
>>>
>>> Signed-off-by: Philippe De Swert <philippedeswert@gmail.com>
>> This patch is good also.
>> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>

Thanks for the reminder -- pushed to mmc-next for 3.5.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-10  0:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 20:31 [PATCH 1/2] mmc: Avoid null pointer dereference Philippe De Swert
2012-04-12  1:45 ` Namjae Jeon
2012-05-10  0:43   ` Namjae Jeon
2012-05-10  0:54     ` Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.