From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Hans J. Koch" Subject: [PATCH] can: Fix possible NULL pointer dereference in ems_usb.c Date: Tue, 20 Apr 2010 15:55:40 +0200 Message-ID: <20100420135538.GA1994@bluebox.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org To: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: socketcan-core-bounces-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org Errors-To: socketcan-core-bounces-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org List-Id: netdev.vger.kernel.org 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" --- 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; }