diff options
author | Alan Cox <alan@linux.intel.com> | 2012-07-23 22:42:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-24 16:54:16 -0400 |
commit | c66b9b7d365444b433307ebb18734757cb668a02 (patch) | |
tree | 36a8742f784bd7f0b18df92689ba9142b3431476 /drivers/net/caif | |
parent | 3324d024ba4bebb74a78d84b925b59df73a92fbd (diff) |
caif: fix NULL pointer check
Reported-by: <rucsoftsec@gmail.com>
Resolves-bug: http://bugzilla.kernel.org/show_bug?44441
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/caif')
-rw-r--r-- | drivers/net/caif/caif_serial.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) | |||
325 | 325 | ||
326 | sprintf(name, "cf%s", tty->name); | 326 | sprintf(name, "cf%s", tty->name); |
327 | dev = alloc_netdev(sizeof(*ser), name, caifdev_setup); | 327 | dev = alloc_netdev(sizeof(*ser), name, caifdev_setup); |
328 | if (!dev) | ||
329 | return -ENOMEM; | ||
330 | |||
328 | ser = netdev_priv(dev); | 331 | ser = netdev_priv(dev); |
329 | ser->tty = tty_kref_get(tty); | 332 | ser->tty = tty_kref_get(tty); |
330 | ser->dev = dev; | 333 | ser->dev = dev; |