public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>,
	devel@driverdev.osuosl.org, Chaitanya Hazarey <c@24.io>,
	linux-kernel@vger.kernel.org, Greg Donald <gdonald@gmail.com>,
	Koray Gulcu <koray.gulcu@ozu.edu.tr>
Subject: Re: [PATCH v2] staging: rtl8192u: r8192U_core: Fix for possible null pointer dereference
Date: Thu, 5 Feb 2015 15:27:45 +0300	[thread overview]
Message-ID: <20150205122745.GF5336@mwanda> (raw)
In-Reply-To: <1422557952-4209-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

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).

> 
> This was found using a static code analysis program called cppcheck
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  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

Delete these kinds of comments, please.


> +		stats->RxIs40MHzPacket = driver_info->BW;
>  		TranslateRxSignalStuff819xUsb(skb, stats, driver_info);
> -
> +	}

regards,
dan carpenter


  parent reply	other threads:[~2015-02-05 12:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 18:59 [PATCH v2] staging: rtl8192u: r8192U_core: Fix for possible null pointer dereference Rickard Strandqvist
2015-02-02 16:51 ` Sudip Mukherjee
2015-02-04 20:05   ` Rickard Strandqvist
2015-02-05 12:27 ` Dan Carpenter [this message]
2015-02-05 12:43   ` Sudip Mukherjee
2015-02-05 12:51     ` Dan Carpenter
2015-02-05 17:39       ` Rickard Strandqvist
2015-02-06 14:32         ` Sudip Mukherjee
2015-02-07 13:04           ` Rickard Strandqvist

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150205122745.GF5336@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=c@24.io \
    --cc=devel@driverdev.osuosl.org \
    --cc=gdonald@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=koray.gulcu@ozu.edu.tr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=rickard_strandqvist@spectrumdigital.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox