diff options
-rw-r--r-- | net/ax25/ax25_uid.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c index 57aeba729bae..832bcf092a01 100644 --- a/net/ax25/ax25_uid.c +++ b/net/ax25/ax25_uid.c | |||
@@ -148,9 +148,13 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) | |||
148 | { | 148 | { |
149 | struct ax25_uid_assoc *pt; | 149 | struct ax25_uid_assoc *pt; |
150 | struct hlist_node *node; | 150 | struct hlist_node *node; |
151 | int i = 0; | 151 | int i = 1; |
152 | 152 | ||
153 | read_lock(&ax25_uid_lock); | 153 | read_lock(&ax25_uid_lock); |
154 | |||
155 | if (*pos == 0) | ||
156 | return SEQ_START_TOKEN; | ||
157 | |||
154 | ax25_uid_for_each(pt, node, &ax25_uid_list) { | 158 | ax25_uid_for_each(pt, node, &ax25_uid_list) { |
155 | if (i == *pos) | 159 | if (i == *pos) |
156 | return pt; | 160 | return pt; |
@@ -162,8 +166,10 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) | |||
162 | static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 166 | static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
163 | { | 167 | { |
164 | ++*pos; | 168 | ++*pos; |
165 | 169 | if (v == SEQ_START_TOKEN) | |
166 | return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, | 170 | return ax25_uid_list.first; |
171 | else | ||
172 | return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, | ||
167 | ax25_uid_assoc, uid_node); | 173 | ax25_uid_assoc, uid_node); |
168 | } | 174 | } |
169 | 175 | ||