Skip to content

Commit

Permalink
[NETPOLL]: Set poll_owner to -1 before unlocking in netpoll_poll_unlo…
Browse files Browse the repository at this point in the history
…ck()

This trivial patch moves the assignment of poll_owner to -1 inside of
the lock.  This fixes a potential SMP race in the code.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jeff Moyer authored and David S. Miller committed Jun 23, 2005
1 parent f31f5f0 commit 6ca4f65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/netpoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ static inline void netpoll_poll_lock(struct net_device *dev)
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);
}
}

Expand Down

0 comments on commit 6ca4f65

Please sign in to comment.