From patchwork Fri Jul 19 20:56:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sucheta Chakraborty X-Patchwork-Id: 260355 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 E5D5B2C0097 for ; Sat, 20 Jul 2013 07:24:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752753Ab3GSVYf (ORCPT ); Fri, 19 Jul 2013 17:24:35 -0400 Received: from mail-db9lp0252.outbound.messaging.microsoft.com ([213.199.154.252]:45537 "EHLO db9outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838Ab3GSVYF (ORCPT ); Fri, 19 Jul 2013 17:24:05 -0400 Received: from mail62-db9-R.bigfish.com (10.174.16.253) by DB9EHSOBE012.bigfish.com (10.174.14.75) with Microsoft SMTP Server id 14.1.225.22; Fri, 19 Jul 2013 21:24:03 +0000 Received: from mail62-db9 (localhost [127.0.0.1]) by mail62-db9-R.bigfish.com (Postfix) with ESMTP id 8BCC5640281; Fri, 19 Jul 2013 21:24:03 +0000 (UTC) X-Forefront-Antispam-Report: CIP:198.70.193.115; KIP:(null); UIP:(null); IPV:NLI; H:avcashub1.qlogic.com; RD:avcashub1.qlogic.com; EFVD:NLI X-SpamScore: 0 X-BigFish: VPS0(zzzz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz1de098h1de097h8275bhz2fh2a8h668h839hd24he5bhf0ah107ah11b5h121eh1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14afh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1e23h1155h) Received-SPF: pass (mail62-db9: domain of qlogic.com designates 198.70.193.115 as permitted sender) client-ip=198.70.193.115; envelope-from=sucheta.chakraborty@qlogic.com; helo=avcashub1.qlogic.com ; 1.qlogic.com ; Received: from mail62-db9 (localhost.localdomain [127.0.0.1]) by mail62-db9 (MessageSwitch) id 1374269041562905_7497; Fri, 19 Jul 2013 21:24:01 +0000 (UTC) Received: from DB9EHSMHS001.bigfish.com (unknown [10.174.16.251]) by mail62-db9.bigfish.com (Postfix) with ESMTP id 84E3F20023B; Fri, 19 Jul 2013 21:24:01 +0000 (UTC) Received: from avcashub1.qlogic.com (198.70.193.115) by DB9EHSMHS001.bigfish.com (10.174.14.11) with Microsoft SMTP Server (TLS) id 14.16.227.3; Fri, 19 Jul 2013 21:24:01 +0000 Received: from dut6217.mv.qlogic.com (172.29.56.217) by qlc.com (10.1.4.190) with Microsoft SMTP Server id 14.2.318.1; Fri, 19 Jul 2013 14:23:58 -0700 Received: by dut6217.mv.qlogic.com (Postfix, from userid 0) id A3A97522195; Fri, 19 Jul 2013 16:56:50 -0400 (EDT) From: Sucheta Chakraborty To: CC: , Subject: [PATCH net 3/9] qlcnic: Fix NULL pointer dereference in VF probe path. Date: Fri, 19 Jul 2013 16:56:28 -0400 Message-ID: <1374267394-27697-4-git-send-email-sucheta.chakraborty@qlogic.com> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1374267394-27697-1-git-send-email-sucheta.chakraborty@qlogic.com> References: <1374267394-27697-1-git-send-email-sucheta.chakraborty@qlogic.com> MIME-Version: 1.0 X-OriginatorOrg: qlogic.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org o Check for non-NULL set_mac_filter_count function pointer before calling it fixes the panic. This patch fixes regression introduced by patch "qlcnic: Secondary unicast MAC address support." with commit id 168e4fb54c11865668ad50eff81b5f2729e0e0f4. Signed-off-by: Sucheta Chakraborty --- drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index b00cf56..f4bb8f5 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h @@ -1869,7 +1869,8 @@ static inline void qlcnic_free_mac_list(struct qlcnic_adapter *adapter) static inline void qlcnic_set_mac_filter_count(struct qlcnic_adapter *adapter) { - adapter->ahw->hw_ops->set_mac_filter_count(adapter); + if (adapter->ahw->hw_ops->set_mac_filter_count) + adapter->ahw->hw_ops->set_mac_filter_count(adapter); } static inline void qlcnic_dev_request_reset(struct qlcnic_adapter *adapter,