From 6c70dd66537ed4c619c022cb0d379da1c259b267 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 9 Oct 2006 15:50:10 -0300 Subject: Bt8xx/dvb-bt8xx.c: check kmalloc() return value. From: Amit Choudhary Check the return value of kmalloc() in function frontend_init(), in file drivers/media/dvb/bt8xx/dvb-bt8xx.c. Signed-off-by: Amit Choudhary Signed-off-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c index d4cac5a7b..dfe79310a 100644 --- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c @@ -666,6 +666,10 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) case 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; -- cgit v1.2.3