Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755466AbbBGOwt (ORCPT ); Sat, 7 Feb 2015 09:52:49 -0500 Received: from mail-lb0-f181.google.com ([209.85.217.181]:36966 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753155AbbBGOws (ORCPT ); Sat, 7 Feb 2015 09:52:48 -0500 From: Rickard Strandqvist To: Greg Kroah-Hartman , Peter P Waskiewicz Jr Cc: Rickard Strandqvist , Antoine Schweitzer-Chaput , Ana Rey , Chaitanya Hazarey , Koray Gulcu , Greg Donald , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging: rtl8192u: r8192U_core: Fix driver_info dereference as a null pointer Date: Sat, 7 Feb 2015 15:56:10 +0100 Message-Id: <1423320970-10750-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1296 Lines: 39 Fix possible use of use of driver_info as a null pointer in query_rxdesc_status() This could happen if stats->RxIs40MHzPacket still has the default value of zero. Signed-off-by: Rickard Strandqvist --- drivers/staging/rtl8192u/r8192U_core.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index e031a25..df43b6d 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -4474,13 +4474,10 @@ static void query_rxdesc_status(struct sk_buff *skb, skb_pull(skb, stats->RxBufShift + stats->RxDrvInfoSize); } - /* for debug 2008.5.29 */ - - //added by vivi, for MP, 20080108 - stats->RxIs40MHzPacket = driver_info->BW; - if (stats->RxDrvInfoSize != 0) + if (driver_info) { + stats->RxIs40MHzPacket = driver_info->BW; TranslateRxSignalStuff819xUsb(skb, stats, driver_info); - + } } static void rtl8192_rx_nomal(struct sk_buff *skb) -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/