[net,3/9] qlcnic: Fix NULL pointer dereference in VF probe path.

Submitted by Sucheta Chakraborty on July 19, 2013, 8:56 p.m.


Message ID 1374267394-27697-4-git-send-email-sucheta.chakraborty@qlogic.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Sucheta Chakraborty July 19, 2013, 8:56 p.m.
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 <sucheta.chakraborty@qlogic.com>
 drivers/net/ethernet/qlogic/qlcnic/qlcnic.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

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,