]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
benet: be_resume needs to protect be_open with rtnl_lock
authorHannes Frederic Sowa <hannes@stressinduktion.org>
Mon, 18 Apr 2016 19:19:42 +0000 (21:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Apr 2016 19:35:07 +0000 (15:35 -0400)
be_open calls down to functions which expects rtnl lock to be held.

Cc: Sathya Perla <sathya.perla@broadcom.com>
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Padmanabh Ratnakar <padmanabh.ratnakar@broadcom.com>
Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c

index 536686476369bfb242ceca0e28a436d150a1ed15..ed98ef1ecac38d77edf7bb66c206d0099c0ddfef 100644 (file)
@@ -4890,11 +4890,13 @@ static int be_resume(struct be_adapter *adapter)
        if (status)
                return status;
 
-       if (netif_running(netdev)) {
+       rtnl_lock();
+       if (netif_running(netdev))
                status = be_open(netdev);
-               if (status)
-                       return status;
-       }
+       rtnl_unlock();
+
+       if (status)
+               return status;
 
        netif_device_attach(netdev);