caif: fix NULL pointer check
Subsystems (2)
PATCH 1/1 caif: fix NULL pointer check
From: Alan Cox <[email protected]>
Reported-by <[email protected]>
Resolves-bug: http://bugzilla.kernel.org/show_bug?44441
Signed-off-by Alan Cox <[email protected]>
---
drivers/net/caif/caif_serial.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/caif/caif_serial.c +3 -0
@@ -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 ==NULL ) +return -ENOMEM ; + ser =netdev_priv (dev); ser->tty =tty_kref_get (tty); ser->dev = dev;
David Miller
maintainerFrom: Alan Cox <[email protected]>
Date: Tue, 24 Jul 2012 13:42:14 +0100
Quoted 5 lines
From: Alan Cox <[email protected]>
Reported-by <[email protected]>Resolves-bug: http://bugzilla.kernel.org/show_bug?44441
Signed-off-by Alan Cox <[email protected]>
Applied and queued up for -stable.
drivers/net/caif/caif_serial.c static int ldisc_open(struct tty_struct *tty) · line 328
Quoted 1 line
drivers/net/caif/caif_serial.c +1
-0+if (dev ==NULL )
I adjusted this to be "if (!dev)"