Skip to content

Commit

Permalink
jme: Prevent possible read re-order error
Browse files Browse the repository at this point in the history
Adding read memory barrier in between flag reading and data reading of
receive descriptors. This prevents the data being read before hardware
complete writing informations.

Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Guo-Fu Tseng authored and David S. Miller committed Oct 21, 2010
1 parent 3ee9401 commit ea192aa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/jme.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ jme_process_receive(struct jme_adapter *jme, int limit)
goto out;
--limit;

rmb();
desccnt = rxdesc->descwb.desccnt & RXWBDCNT_DCNT;

if (unlikely(desccnt > 1 ||
Expand Down

0 comments on commit ea192aa

Please sign in to comment.