[patch 1/3] netpoll: set poll_owner to -1 before unlocking in netpoll_poll_unlock
From: Jeff Moyer
Date: Wed Jun 22 2005 - 20:31:59 EST
Hi,
This trivial patch moves the assignment of poll_owner to -1 inside of the
lock. This fixes a potential SMP race in the code.
-Jeff
Signed-off-by: Jeff Moyer <jmoyer@xxxxxxxxxx>
---
--- linux-2.6.12/include/linux/netpoll.h.orig 2005-06-22 18:47:12.917261688 -0400
+++ linux-2.6.12/include/linux/netpoll.h 2005-06-22 18:47:15.799783018 -0400
@@ -53,8 +53,8 @@ static inline void netpoll_poll_lock(str
static inline void netpoll_poll_unlock(struct net_device *dev)
{
if (dev->np) {
- spin_unlock(&dev->np->poll_lock);
dev->np->poll_owner = -1;
+ spin_unlock(&dev->np->poll_lock);
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/