From 70812522b847bdb8fabee963191734f5fa3143f3 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Sun, 29 Oct 2006 22:46:35 -0800 Subject: [PATCH] [PATCH] isdn/gigaset: avoid cs->dev null pointer dereference When gigaset_initbcs() is called, cs->dev is not initialized yet. If dev_alloc_skb() failed in this function, NULL poinster dereference will happen at dev_warn(). Cc: Kai Germaschewski Cc: Hansjoerg Lipp Cc: Tilman Schmidt Acked-by: Karsten Keil Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/isdn/gigaset/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c index aca165d43aa0..d8d256dadddf 100644 --- a/drivers/isdn/gigaset/common.c +++ b/drivers/isdn/gigaset/common.c @@ -616,7 +616,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs, } else if ((bcs->skb = dev_alloc_skb(SBUFSIZE + HW_HDR_LEN)) != NULL) skb_reserve(bcs->skb, HW_HDR_LEN); else { - dev_warn(cs->dev, "could not allocate skb\n"); + gig_dbg(DEBUG_INIT, "could not allocate skb\n"); bcs->inputstate |= INS_skip_frame; } -- 2.20.1