Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757256AbbBEMne (ORCPT ); Thu, 5 Feb 2015 07:43:34 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:43350 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752631AbbBEMnd (ORCPT ); Thu, 5 Feb 2015 07:43:33 -0500 Date: Thu, 5 Feb 2015 18:13:22 +0530 From: Sudip Mukherjee To: Dan Carpenter Cc: Rickard Strandqvist , Greg Kroah-Hartman , Peter P Waskiewicz Jr , devel@driverdev.osuosl.org, Chaitanya Hazarey , linux-kernel@vger.kernel.org, Greg Donald , Koray Gulcu Subject: Re: [PATCH v2] staging: rtl8192u: r8192U_core: Fix for possible null pointer dereference Message-ID: <20150205124322.GA8137@sudip-PC> References: <1422557952-4209-1-git-send-email-rickard_strandqvist@spectrumdigital.se> <20150205122745.GF5336@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150205122745.GF5336@mwanda> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1945 Lines: 61 On Thu, Feb 05, 2015 at 03:27:45PM +0300, Dan Carpenter wrote: > I don't know if this patch was merged before Greg cleaned out his inbox. > > It's a good patch if you could just clean it up a bit. > > 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. > > The change log should say that "driver_info" is the NULL pointer. It > should say that by default stats->RxIs40MHzPacket is zero (as opposed to > uninitialized memory). > > > > > +++ 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 > > Delete these kinds of comments, please. > > > > + stats->RxIs40MHzPacket = driver_info->BW; > > TranslateRxSignalStuff819xUsb(skb, stats, driver_info); > > - > > + } but in the present form the logic is changing. can you please check the following idea - if (driver_info) { stats->RxIs40MHzPacket = driver_info->BW; if (stats->RxDrvInfoSize != 0) TranslateRxSignalStuff819xUsb(skb, stats, driver_info); } regards sudip > > regards, > dan carpenter > > -- > 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/ -- 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/