From patchwork Sun May 31 09:35:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 6515571 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 93B749F1C1 for ; Sun, 31 May 2015 09:36:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D060720626 for ; Sun, 31 May 2015 09:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16EF820685 for ; Sun, 31 May 2015 09:36:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758215AbbEaJgS (ORCPT ); Sun, 31 May 2015 05:36:18 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:36305 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758090AbbEaJgK (ORCPT ); Sun, 31 May 2015 05:36:10 -0400 Received: by wibdq8 with SMTP id dq8so4697161wib.1; Sun, 31 May 2015 02:36:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Yk41w62TOt9KHTf9IJbTCQgRKafca1+1EZhz86rsFMg=; b=HnEMEa6YKIUNLZ8I38+a+uSi0KK5l+tVTdPmY++/ljq9+kWrOxTNWwYRGjvQtoBONE 9oBgEWF/HFGdba+/KbavK9wQ/+kECCKyHD39xuZEs2VztysQ4E3AxGqxoyg24QBEsNBx R87LYIN5Ckck0pOgoMZnP+LLnH+KemkoFzadmXqcl/4xE36fUvggU/5woSSlWp6pq3qZ IbC0jV9aFDoYUnnmY7qwrT5+kXHBw4+XR7ehdJU4oNrIgY/tzEC7EwgtVbfCvypBSISY KTtqEu+CaVnBzSy6vyl0HHgt2VVXsxAr9abDDH6J1fCQNJjikECcIs1wYYmoa/CYDbrV G7VA== X-Received: by 10.180.82.169 with SMTP id j9mr11245383wiy.54.1433064969158; Sun, 31 May 2015 02:36:09 -0700 (PDT) Received: from tipsey.3.home (188.31.131.59.threembb.co.uk. [188.31.131.59]) by mx.google.com with ESMTPSA id t17sm11193426wij.1.2015.05.31.02.36.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 31 May 2015 02:36:08 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley , Subject: [PATCH 9/9] staging: vt6655: device_rx_srv check sk_buff is NULL Date: Sun, 31 May 2015 10:35:28 +0100 Message-Id: <1433064928-2139-9-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433064928-2139-1-git-send-email-tvboxspy@gmail.com> References: <1433064928-2139-1-git-send-email-tvboxspy@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is a small chance that pRD->pRDInfo->skb could go NULL while the interrupt is processing. Put NULL check on loop to break out. Signed-off-by: Malcolm Priestley Cc: --- drivers/staging/vt6655/device_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index aec3cce..8dbde24 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -805,6 +805,10 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx) pRD = pRD->next) { if (works++ > 15) break; + + if (!pRD->pRDInfo->skb) + break; + if (vnt_receive_frame(pDevice, pRD)) { if (!device_alloc_rx_buf(pDevice, pRD)) { dev_err(&pDevice->pcid->dev,