Commit 6effee68 authored by David S. Miller's avatar David S. Miller

can: Remove SKB list assumptions in rx-offload.c

Eliminate code which assumes that SKBs and skb_queue_head objects
can be cast to eachother during list processing.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 992cba7e
...@@ -79,7 +79,7 @@ static int can_rx_offload_napi_poll(struct napi_struct *napi, int quota) ...@@ -79,7 +79,7 @@ static int can_rx_offload_napi_poll(struct napi_struct *napi, int quota)
static inline void __skb_queue_add_sort(struct sk_buff_head *head, struct sk_buff *new, static inline void __skb_queue_add_sort(struct sk_buff_head *head, struct sk_buff *new,
int (*compare)(struct sk_buff *a, struct sk_buff *b)) int (*compare)(struct sk_buff *a, struct sk_buff *b))
{ {
struct sk_buff *pos, *insert = (struct sk_buff *)head; struct sk_buff *pos, *insert = NULL;
skb_queue_reverse_walk(head, pos) { skb_queue_reverse_walk(head, pos) {
const struct can_rx_offload_cb *cb_pos, *cb_new; const struct can_rx_offload_cb *cb_pos, *cb_new;
...@@ -99,7 +99,9 @@ static inline void __skb_queue_add_sort(struct sk_buff_head *head, struct sk_buf ...@@ -99,7 +99,9 @@ static inline void __skb_queue_add_sort(struct sk_buff_head *head, struct sk_buf
insert = pos; insert = pos;
break; break;
} }
if (!insert)
__skb_queue_head(head, new);
else
__skb_queue_after(head, insert, new); __skb_queue_after(head, insert, new);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment