Subject: [PATCH] can: Fix possible NULL pointer dereference in ems_usb.c

From: "Hans J. Koch" <[email-masked]>
Date: Tue, 20 Apr 2010 15:55:40 +0200

In ems_usb_probe(), a pointer is dereferenced after making sure it is NULL...

This patch replaces dev_err() with printk() to avoid this.

Signed-off-by: "Hans J. Koch" <[email-masked]>
---
 drivers/net/can/usb/ems_usb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.34-rc/drivers/net/can/usb/ems_usb.c
===================================================================
--- linux-2.6.34-rc.orig/drivers/net/can/usb/ems_usb.c	2010-04-20 15:32:25.000000000 +0200
+++ linux-2.6.34-rc/drivers/net/can/usb/ems_usb.c	2010-04-20 15:33:20.000000000 +0200
@@ -1006,7 +1006,7 @@
 
 	netdev = alloc_candev(sizeof(struct ems_usb), MAX_TX_URBS);
 	if (!netdev) {
-		dev_err(netdev->dev.parent, "Couldn't alloc candev\n");
+		printk(KERN_ERR "ems_usb: Couldn't alloc candev\n");
 		return -ENOMEM;
 	}