Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757114AbdLPTri (ORCPT ); Sat, 16 Dec 2017 14:47:38 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:37394 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756815AbdLPTrd (ORCPT ); Sat, 16 Dec 2017 14:47:33 -0500 X-Google-Smtp-Source: ACJfBosDuRGqLkTxwj/DPQt7PYhIsBdr4LGPt4Gr7Rl8hIyeoy1QrKAM0Qs0ZqlWeOoEEEA5Z+V3VA== From: Arvind Yadav To: isdn@linux-pingi.de, stephen@networkplumber.org, davem@davemloft.net, johannes.berg@intel.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH] isdn: avm: Handle return value of skb_dequeue() Date: Sun, 17 Dec 2017 01:17:23 +0530 Message-Id: <5818ec104ed4354db3625ac8c7741d771719e4d4.1513453258.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 599 Lines: 23 skb_dequeue() will return NULL for an empty list or a pointer to the head element. Signed-off-by: Arvind Yadav --- 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