From patchwork Tue Apr 20 13:55:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hans J. Koch" X-Patchwork-Id: 50543 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 889B1B7CF5 for ; Tue, 20 Apr 2010 23:55:52 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754742Ab0DTNzr (ORCPT ); Tue, 20 Apr 2010 09:55:47 -0400 Received: from www.tglx.de ([62.245.132.106]:55149 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754574Ab0DTNzq (ORCPT ); Tue, 20 Apr 2010 09:55:46 -0400 Received: from bluebox.tec.linutronix.de (p549AF525.dip.t-dialin.net [84.154.245.37]) (authenticated bits=0) by www.tglx.de (8.13.8/8.13.8/TGLX-2007100201) with ESMTP id o3KDte3j023915 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Tue, 20 Apr 2010 15:55:41 +0200 Received: from hans by bluebox.tec.linutronix.de with local (Exim 4.71) (envelope-from ) id 1O4DvQ-0001XL-Ce; Tue, 20 Apr 2010 15:55:40 +0200 Date: Tue, 20 Apr 2010 15:55:40 +0200 From: "Hans J. Koch" To: netdev@vger.kernel.org Cc: socketcan-core@lists.berlios.de, Sebastian Haas Subject: [PATCH] can: Fix possible NULL pointer dereference in ems_usb.c Message-ID: <20100420135538.GA1994@bluebox.local> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.95.1 at www.tglx.de X-Virus-Status: Clean X-Spam-Status: No, score=2.4 required=5.0 tests=AWL,RCVD_IN_NJABL_PROXY, RCVD_IN_PBL, RCVD_IN_SORBS_DUL, RDNS_DYNAMIC autolearn=no version=3.2.5 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on www.tglx.de Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: 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(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }