From patchwork Fri Sep 10 11:54:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 64382 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 4C2BFB711E for ; Fri, 10 Sep 2010 21:54:44 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753345Ab0IJLyk (ORCPT ); Fri, 10 Sep 2010 07:54:40 -0400 Received: from mail-qw0-f46.google.com ([209.85.216.46]:56012 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753261Ab0IJLyi (ORCPT ); Fri, 10 Sep 2010 07:54:38 -0400 Received: by qwh6 with SMTP id 6so1368559qwh.19 for ; Fri, 10 Sep 2010 04:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=RqQv2m7xl8jDIZ/6bCCs1KyWW8phXthoGD3Zpk20k5o=; b=ZxFwhGIrs+4DYaJ2OI7tCV97maMRdJ7CAKTXSYXIpHxdU/7bSeXpuErF1CTDOBtG7E cA/e7PK7s3AAksVC3zHiH+pOy31lKhSLvd9BvcYlZO/i0ACbOM69qCnnWG40ApLnvwRd e+3EiWcLudwxyNt00xHFVc2BeremNWwjyalV8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=lLz/J8muTpzv7Gz8BUkkbTjzM5ph7EtlbY69fFJQwJ8hWreFI2ySXsEXAXr50rU+OA yFI3aai5F2uIpQhBNZ3X+PlJoHgfk82Jwtm2BAHnVwQKQ8f2holmwvtWsFNRLMAn+TF0 4bqt6CrX6LXkSXV4/VTUjhli1pkBU0pxxVMz4= Received: by 10.229.213.199 with SMTP id gx7mr513091qcb.141.1284119678095; Fri, 10 Sep 2010 04:54:38 -0700 (PDT) Received: from bicker ([41.205.146.22]) by mx.google.com with ESMTPS id q8sm2576705qcs.24.2010.09.10.04.54.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 10 Sep 2010 04:54:37 -0700 (PDT) Date: Fri, 10 Sep 2010 13:54:23 +0200 From: Dan Carpenter To: Ramkrishna Vepa Cc: Sivakumar Subramani , Sreenivasa Honnur , Jon Mason , "David S. Miller" , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] vxge: potential NULL dereference Message-ID: <20100910115423.GC5959@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org At the start of the function we test whether the "vpath" is NULL but we need another test here as well. Signed-off-by: Dan Carpenter --- This is a static checker bug, I'm not sure if we ever pass a NULL pointer for "vpath". -- 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 diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c index cedf08f..1790748 100644 --- a/drivers/net/vxge/vxge-traffic.c +++ b/drivers/net/vxge/vxge-traffic.c @@ -2157,7 +2157,8 @@ out2: (alarm_event == VXGE_HW_EVENT_UNKNOWN)) return VXGE_HW_OK; - __vxge_hw_device_handle_error(hldev, vpath->vp_id, alarm_event); + if (vpath) + __vxge_hw_device_handle_error(hldev, vpath->vp_id, alarm_event); if (alarm_event == VXGE_HW_EVENT_SERR) return VXGE_HW_ERR_CRITICAL;