[PATCH] isdn: avm: Handle return value of skb_dequeue()

Subsystems: the rest

STALE3226d

2 messages, 2 authors, 2017-12-19 · open the first message on its own page

[PATCH] isdn: avm: Handle return value of skb_dequeue()

From: Arvind Yadav <hidden>
Date: 2017-12-16 19:47:38

skb_dequeue() will return NULL for an empty list or a pointer
to the head element.

Signed-off-by: Arvind Yadav <redacted>
---
 drivers/isdn/hardware/avm/b1dma.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c
index 9538a9e..10df578 100644
--- a/drivers/isdn/hardware/avm/b1dma.c
+++ b/drivers/isdn/hardware/avm/b1dma.c
@@ -375,6 +375,8 @@ static void b1dma_dispatch_tx(avmcard *card)
 	void *p;
 
 	skb = skb_dequeue(&dma->send_queue);
+	if (!skb)
+		return;
 
 	len = CAPIMSG_LEN(skb->data);
 
-- 
2.7.4

Re: [PATCH] isdn: avm: Handle return value of skb_dequeue()

From: David Miller <davem@davemloft.net>
Date: 2017-12-19 16:05:04

From: Arvind Yadav <redacted>
Date: Sun, 17 Dec 2017 01:17:23 +0530
skb_dequeue() will return NULL for an empty list or a pointer
to the head element.

Signed-off-by: Arvind Yadav <redacted>
There is no code path where this is possible.

The two call sites:

1) Explicitly add an SKB to the queue

OR

2) Explcitily guard the call with an skb_queue_empty() check

Therefore the stated condition is not possible.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help