Commit:     b34bd06e485abf5b24fc13a9a988ebf4d2915dd6
Parent:     7be77e20d59fc3dd3fdde31641e0bc821114d26b
Author:     Paul E. McKenney <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 31 00:38:48 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jul 31 15:39:40 2007 -0700

    bpqether: fix rcu usage
    The rcu_dereference() primitive needs to be applied to an l-value in order 
    ensure that compiler writers don't get an opportunity to apply reordering
    optimizations that could result in multiple fetches or in other misbehavior.
    This patch pulls the rcu_dereference() calls in bpq_seq_next() up to the 
    at which the fetched pointers are still l-values, rather than after
    list_entry() has transformed them into r-values.
    Signed-off-by: Paul E. McKenney <[EMAIL PROTECTED]>
    Cc: Jeff Garzik <[EMAIL PROTECTED]>
    Cc: Ralf Baechle <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 drivers/net/hamradio/bpqether.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 656f278..cc0ee93 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -413,12 +413,12 @@ static void *bpq_seq_next(struct seq_file *seq, void *v, 
loff_t *pos)
        if (v == SEQ_START_TOKEN)
-               p =;
+               p = rcu_dereference(;
-               p = ((struct bpqdev *)v)->;
+               p = rcu_dereference(((struct bpqdev *)v)->;
        return (p == &bpq_devices) ? NULL 
-               : rcu_dereference(list_entry(p, struct bpqdev, bpq_list));
+               : list_entry(p, struct bpqdev, bpq_list);
 static void bpq_seq_stop(struct seq_file *seq, void *v)
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to