netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netpoll fix racy dev->flags usage
@ 2005-03-10 23:22 Matt Mackall
  2005-03-23  2:40 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Mackall @ 2005-03-10 23:22 UTC (permalink / raw)
  To: Dave Miller, netdev, Patrick McHardy

Put ndev->flags usage under the lock. Spotted by Patrick McHardy.

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: np/net/core/netpoll.c
===================================================================
--- np.orig/net/core/netpoll.c	2005-03-10 17:02:03.000000000 -0600
+++ np/net/core/netpoll.c	2005-03-10 17:12:46.000000000 -0600
@@ -632,16 +632,13 @@ int netpoll_setup(struct netpoll *np)
 	}
 
 	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();

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] netpoll fix racy dev->flags usage
  2005-03-10 23:22 [PATCH] netpoll fix racy dev->flags usage Matt Mackall
@ 2005-03-23  2:40 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2005-03-23  2:40 UTC (permalink / raw)
  To: Matt Mackall; +Cc: netdev, kaber

On Thu, 10 Mar 2005 15:22:46 -0800
Matt Mackall <mpm@selenic.com> wrote:

> Put ndev->flags usage under the lock. Spotted by Patrick McHardy.
> 
> Signed-off-by: Matt Mackall <mpm@selenic.com>

Applied, thanks Matt.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-23  2:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-10 23:22 [PATCH] netpoll fix racy dev->flags usage Matt Mackall
2005-03-23  2:40 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).