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 <[email protected]>
---
 drivers/infiniband/hw/usnic/usnic_ib_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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) {
-- 
1.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to