From: Alan Cox Date: Tue, 24 Jul 2012 02:42:14 +0000 (+0000) Subject: caif: fix NULL pointer check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c66b9b7d365444b433307ebb18734757cb668a02;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git caif: fix NULL pointer check Reported-by: Resolves-bug: http://bugzilla.kernel.org/show_bug?44441 Signed-off-by: Alan Cox Signed-off-by: David S. Miller --- diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c index 8a3054b84812..5de74e762021 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;