[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120724124207.4444.49789.stgit@localhost.localdomain>
Date: Tue, 24 Jul 2012 13:42:14 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: sjur.brandeland@...ricsson.com, netdev@...r.kernel.org
Subject: [PATCH] caif: fix NULL pointer check
From: Alan Cox <alan@...ux.intel.com>
Reported-by: <rucsoftsec@...il.com>
Resolves-bug: http://bugzilla.kernel.org/show_bug?44441
Signed-off-by: Alan Cox <alan@...ux.intel.com>
---
drivers/net/caif/caif_serial.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
index 8a3054b..7e84175 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 == NULL)
+ return -ENOMEM;
+
ser = netdev_priv(dev);
ser->tty = tty_kref_get(tty);
ser->dev = dev;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists