diff mbox

[for-next,14/15] IB/usnic: Use netdev_notifier_info_to_dev to get netdev

Message ID 1387571206-8043-15-git-send-email-umalhi@cisco.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Upinder Malhi (umalhi) Dec. 20, 2013, 8:26 p.m. UTC
usNIC netdev notifier is casting the *ptr directly to netdev.
This is a bug.  The netdev pointer should be retrieved via
netdev_notifier_info_to_dev.

Signed-off-by: Upinder Malhi <umalhi@cisco.com>
---
 drivers/infiniband/hw/usnic/usnic_ib_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/infiniband/hw/usnic/usnic_ib_main.c b/drivers/infiniband/hw/usnic/usnic_ib_main.c
index ae4e544..bbe614b 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_main.c
+++ b/drivers/infiniband/hw/usnic/usnic_ib_main.c
@@ -216,7 +216,7 @@  static int usnic_ib_netdevice_event(struct notifier_block *notifier,
 {
 	struct usnic_ib_dev *us_ibdev;
 
-	struct net_device *netdev = ptr;
+	struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
 
 	mutex_lock(&usnic_ib_ibdev_list_lock);
 	list_for_each_entry(us_ibdev, &usnic_ib_ibdev_list, ib_dev_link) {