From: Alan Cox Date: Tue, 24 Jul 2012 02:42:14 +0000 (+0000) Subject: caif: fix NULL pointer check X-Git-Tag: v3.4.8~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2138dede8c23f5646c81381c71aac37e67b491b0;p=platform%2Fkernel%2Flinux-stable.git caif: fix NULL pointer check [ Upstream commit c66b9b7d365444b433307ebb18734757cb668a02 ] Reported-by: Resolves-bug: http://bugzilla.kernel.org/show_bug?44441 Signed-off-by: Alan Cox Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c index 8a3054b..5de74e7 100644 --- a/drivers/net/caif/caif_serial.c +++ b/drivers/net/caif/caif_serial.c @@ -325,6 +325,9 @@ static int ldisc_open(struct tty_struct *tty) sprintf(name, "cf%s", tty->name); dev = alloc_netdev(sizeof(*ser), name, caifdev_setup); + if (!dev) + return -ENOMEM; + ser = netdev_priv(dev); ser->tty = tty_kref_get(tty); ser->dev = dev;