drivers/media/dvb/bt8xx/dvb-bt8xx.c: check kmalloc() return value.
PATCH 1/1 drivers/media/dvb/bt8xx/dvb-bt8xx.c: check kmalloc() return value.
Description: Check the return value of kmalloc() in function frontend_init(), in file drivers/media/dvb/bt8xx/dvb-bt8xx.c.
drivers/media/dvb/bt8xx/dvb-bt8xx.c +4 -0
@@ -665,6 +665,10 @@ static void frontend_init(struct dvb_bt8case BTTV_BOARD_TWINHAN_DST :/* DST is not a frontend driver !!! */ state = (struct dst_state *)kmalloc (sizeof (struct dst_state ),GFP_KERNEL ); +if (!state) { +printk ("dvb_bt8xx: No memory\n" ); +break ; + }/* Setup the Card */ state->config = &dst_config; state->i2c = card->i2c_adapter;
Quoted 10 lines · Amit Choudhary
Description: Check the return value of
kmalloc()in functionfrontend_init(), in filedrivers/media/dvb/bt8xx/dvb-bt8xx.c.Signed-off-by Amit Choudhary <[email protected]>drivers/media/dvb/bt8xx/dvb-bt8xx.c +0
-0@@ -665,6 +665,10 @@ static void frontend_init(struct dvb_bt8case BTTV_BOARD_TWINHAN_DST :
drivers/media/dvb/bt8xx/dvb-bt8xx.c static void frontend_init(struct dvb_bt8
Quoted 10 lines
drivers/media/dvb/bt8xx/dvb-bt8xx.c +4
-1/* DST is not a frontend driver !!! */ state = (struct dst_state *)kmalloc (sizeof (struct dst_state ),GFP_KERNEL ); +if (!state) { +printk ("dvb_bt8xx: No memory\n" ); +break ; + }/* Setup the Card */ state->config = &dst_config; state->i2c = card->i2c_adapter; -
Thanks,
Manu
Quoted 9 lines · Amit Choudhary
Description: Check the return value of
kmalloc()in functionfrontend_init(), in filedrivers/media/dvb/bt8xx/dvb-bt8xx.c.Signed-off-by Amit Choudhary <[email protected]>drivers/media/dvb/bt8xx/dvb-bt8xx.c +0
-0
drivers/media/dvb/bt8xx/dvb-bt8xx.c static void frontend_init(struct dvb_bt8 · line 669
Quoted 5 lines
drivers/media/dvb/bt8xx/dvb-bt8xx.c +2
-0@@ -665,6 +665,10 @@ static void frontend_init(struct dvb_bt8case BTTV_BOARD_TWINHAN_DST :/* DST is not a frontend driver !!! */ state = (struct dst_state *)kmalloc (sizeof (struct dst_state ),GFP_KERNEL ); +if (!state) { +printk ("dvb_bt8xx: No memory\n" );
KERN_FOO loglevel is missing.
Quoted 6 lines · Olaf Hering
Quoted 4 lines · Amit Choudhary
Description: Check the return value of
kmalloc()in functionfrontend_init(), in filedrivers/media/dvb/bt8xx/dvb-bt8xx.c.Signed-off-by Amit Choudhary <[email protected]>
Quoted 12 lines
drivers/media/dvb/bt8xx/dvb-bt8xx.c static void frontend_init(struct dvb_bt8 · line 669
Quoted 10 lines
drivers/media/dvb/bt8xx/dvb-bt8xx.c +2
-0@@ -665,6 +665,10 @@ static void frontend_init(struct dvb_bt8case BTTV_BOARD_TWINHAN_DST :/* DST is not a frontend driver !!! */ state = (struct dst_state *)kmalloc (sizeof (struct dst_state ),GFP_KERNEL ); +if (!state) { +printk ("dvb_bt8xx: No memory\n" );
KERN_FOOloglevel is missing.
It shouldn't matter though.
Manu
Quoted 16 lines · Manu Abraham
Quoted 15 lines · Amit Choudhary
Description: Check the return value of
kmalloc()in functionfrontend_init(), in filedrivers/media/dvb/bt8xx/dvb-bt8xx.c.Signed-off-by Amit Choudhary <[email protected]>drivers/media/dvb/bt8xx/dvb-bt8xx.c +3
-0@@ -665,6 +665,10 @@ static void frontend_init(struct dvb_bt8case BTTV_BOARD_TWINHAN_DST :/* DST is not a frontend driver !!! */ state = (struct dst_state *)kmalloc (sizeof (struct dst_state ),GFP_KERNEL ); +if (!state) { +printk ("dvb_bt8xx: No memory\n" ); +break ;
Quoted 8 lines
drivers/media/dvb/bt8xx/dvb-bt8xx.c static void frontend_init(struct dvb_bt8
Quoted 5 lines
drivers/media/dvb/bt8xx/dvb-bt8xx.c +1
-1+ }/* Setup the Card */ state->config = &dst_config; state->i2c = card->i2c_adapter; -Signed-off-by Manu Abraham <[email protected]>
Care to send the full patch in a format that we can apply it to the -stable tree?
thanks,
greg k-h
Quoted 25 lines · Greg KH
Quoted 15 lines · Manu Abraham
Quoted 14 lines · Amit Choudhary
Description: Check the return value of
kmalloc()in functionfrontend_init(), in filedrivers/media/dvb/bt8xx/dvb-bt8xx.c.Signed-off-by Amit Choudhary <[email protected]>drivers/media/dvb/bt8xx/dvb-bt8xx.c +2
-0@@ -665,6 +665,10 @@ static void frontend_init(struct dvb_bt8case BTTV_BOARD_TWINHAN_DST :/* DST is not a frontend driver !!! */ state = (struct dst_state *)kmalloc (sizeof (struct dst_state ),GFP_KERNEL ); +if (!state) { +printk ("dvb_bt8xx: No memory\n" );Quoted 8 lines
drivers/media/dvb/bt8xx/dvb-bt8xx.c static void frontend_init(struct dvb_bt8
Quoted 6 lines
drivers/media/dvb/bt8xx/dvb-bt8xx.c +2
-1+break ; + }/* Setup the Card */ state->config = &dst_config; state->i2c = card->i2c_adapter; -Signed-off-by Manu Abraham <[email protected]>
Quoted 3 lines
Care to send the full patch in a format that we can apply it to the -stable tree?
dvb-bt8xx.c | 4 ++++ 1 files changed, 4 insertions(+)
Thanks,
Manu
drivers/media/dvb/bt8xx/dvb-bt8xx.c +4 -0
@@ -666,6 +666,10 @@ static void frontend_init(struct dvb_bt8case BTTV_BOARD_TWINHAN_DST :/* DST is not a frontend driver !!! */ state = (struct dst_state *)kmalloc (sizeof (struct dst_state ),GFP_KERNEL ); +if (!state) { +printk ("%s: Out of Memory !\n" , __func__); +break ; + }/* Setup the Card */ state->config = &dst_config; state->i2c = card->i2c_adapter;
Quoted 31 lines · Manu Abraham
Quoted 25 lines · Greg KH
Quoted 15 lines · Manu Abraham
Quoted 14 lines · Amit Choudhary
Description: Check the return value of
kmalloc()in functionfrontend_init(), in filedrivers/media/dvb/bt8xx/dvb-bt8xx.c.Signed-off-by Amit Choudhary <[email protected]>drivers/media/dvb/bt8xx/dvb-bt8xx.c +2
-0@@ -665,6 +665,10 @@ static void frontend_init(struct dvb_bt8case BTTV_BOARD_TWINHAN_DST :/* DST is not a frontend driver !!! */ state = (struct dst_state *)kmalloc (sizeof (struct dst_state ),GFP_KERNEL ); +if (!state) { +printk ("dvb_bt8xx: No memory\n" );Quoted 8 lines
drivers/media/dvb/bt8xx/dvb-bt8xx.c static void frontend_init(struct dvb_bt8
Quoted 6 lines
drivers/media/dvb/bt8xx/dvb-bt8xx.c +2
-1+break ; + }/* Setup the Card */ state->config = &dst_config; state->i2c = card->i2c_adapter; -Signed-off-by Manu Abraham <[email protected]>Quoted 3 lines
Care to send the full patch in a format that we can apply it to the -stable tree?
Quoted 5 lines
dvb-bt8xx.c | 4 ++++ 1 files changed, 4 insertions(+)Thanks,
Um, can you resend it with the proper description and signed-off-by:
lines so that it can be applied correctly?
And does this solve a real bug, or is it just added error condition checks? If the latter, I don't think it's ok for -stable right now.
thanks,
greg k-h