Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934170AbbBDUFz (ORCPT ); Wed, 4 Feb 2015 15:05:55 -0500 Received: from mail-ie0-f182.google.com ([209.85.223.182]:45729 "EHLO mail-ie0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934063AbbBDUFw (ORCPT ); Wed, 4 Feb 2015 15:05:52 -0500 MIME-Version: 1.0 In-Reply-To: <20150202165127.GA30677@sudip-PC> References: <1422557952-4209-1-git-send-email-rickard_strandqvist@spectrumdigital.se> <20150202165127.GA30677@sudip-PC> Date: Wed, 4 Feb 2015 21:05:50 +0100 Message-ID: Subject: Re: [PATCH v2] staging: rtl8192u: r8192U_core: Fix for possible null pointer dereference From: Rickard Strandqvist To: Sudip Mukherjee Cc: Greg Kroah-Hartman , Peter P Waskiewicz Jr , Antoine Schweitzer-Chaput , Ana Rey , Chaitanya Hazarey , Koray Gulcu , Greg Donald , "devel@driverdev.osuosl.org" , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1930 Lines: 60 2015-02-02 17:51 GMT+01:00 Sudip Mukherjee : > On Thu, Jan 29, 2015 at 07:59:12PM +0100, Rickard Strandqvist wrote: >> Fix a possible null pointer dereference, there is >> otherwise a risk of a possible null pointer dereference. >> >> This was found using a static code analysis program called cppcheck >> >> Signed-off-by: Rickard Strandqvist >> --- >> drivers/staging/rtl8192u/r8192U_core.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c >> index e031a25..4a29237 100644 >> --- a/drivers/staging/rtl8192u/r8192U_core.c >> +++ b/drivers/staging/rtl8192u/r8192U_core.c >> @@ -4476,11 +4476,11 @@ static void query_rxdesc_status(struct sk_buff *skb, >> >> /* for debug 2008.5.29 */ >> >> - //added by vivi, for MP, 20080108 >> - stats->RxIs40MHzPacket = driver_info->BW; >> - if (stats->RxDrvInfoSize != 0) >> + if (driver_info && stats->RxDrvInfoSize != 0) { >> + //added by vivi, for MP, 20080108 >> + stats->RxIs40MHzPacket = driver_info->BW; >> TranslateRxSignalStuff819xUsb(skb, stats, driver_info); >> - >> + } > but isn't the logic getting changed here? > > regards > sudip > >> } Hi Sudip Yes partly, but that's too ensure that driver_info is not null. Se call TranslateRxSignalStuff819xUsb() -> call rtl8192_query_rxphystatus() Where driver_info is pdrvinfo, and is used as: pdrvinfo->RxHT && pdrvinfo->RxRate and more. Or perhaps change in rtl8192_query_rxphystatus() instead? Kind regards Rickard Strandqvist -- 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/