ChangeSet 1.2199.8.27, 2005/03/22 18:39:35-08:00, [EMAIL PROTECTED]

        [NETPOLL]: Fix racy dev->flags usage
        
        Put ndev->flags usage under the lock. Spotted by Patrick McHardy.
        
        Signed-off-by: Matt Mackall <[EMAIL PROTECTED]>
        Signed-off-by: David S. Miller <[EMAIL PROTECTED]>



 netpoll.c |    5 +----
 1 files changed, 1 insertion(+), 4 deletions(-)


diff -Nru a/net/core/netpoll.c b/net/core/netpoll.c
--- a/net/core/netpoll.c        2005-03-26 17:15:57 -08:00
+++ b/net/core/netpoll.c        2005-03-26 17:15:57 -08:00
@@ -632,16 +632,13 @@
        }
 
        if (!netif_running(ndev)) {
-               unsigned short oflags;
                unsigned long atmost, atleast;
 
                printk(KERN_INFO "%s: device %s not up yet, forcing it\n",
                       np->name, np->dev_name);
 
-               oflags = ndev->flags;
-
                rtnl_shlock();
-               if (dev_change_flags(ndev, oflags | IFF_UP) < 0) {
+               if (dev_change_flags(ndev, ndev->flags | IFF_UP) < 0) {
                        printk(KERN_ERR "%s: failed to open %s\n",
                               np->name, np->dev_name);
                        rtnl_shunlock();
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to