Skip to content

Commit

Permalink
seqlock: fix raw_read_seqcount_latch()
Browse files Browse the repository at this point in the history
lockless_dereference() is supposed to take pointer not integer.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Alexey Dobriyan <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alexey Dobriyan authored and torvalds committed May 26, 2016
1 parent ea8ea73 commit 50755bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/seqlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static inline void raw_write_seqcount_barrier(seqcount_t *s)

static inline int raw_read_seqcount_latch(seqcount_t *s)
{
return lockless_dereference(s->sequence);
return lockless_dereference(s)->sequence;
}

/**
Expand Down Expand Up @@ -331,7 +331,7 @@ static inline int raw_read_seqcount_latch(seqcount_t *s)
* unsigned seq, idx;
*
* do {
* seq = lockless_dereference(latch->seq);
* seq = lockless_dereference(latch)->seq;
*
* idx = seq & 0x01;
* entry = data_query(latch->data[idx], ...);
Expand Down

0 comments on commit 50755bc

Please sign in to comment.