public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Mattia Dongili <malattia@linux.it>
To: Dan Carpenter <error27@gmail.com>
Cc: Matthew Garrett <mjg@redhat.com>,
	platform-driver-x86@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch 4/4 v2] sony-laptop: potential null dereference
Date: Sun, 27 Feb 2011 21:06:06 +0000	[thread overview]
Message-ID: <20110227210606.GG29319@kamineko.org> (raw)
In-Reply-To: <20110227141238.GU18043@bicker>

Hi Matthew,

could you pick this and the other 3 up for next?

Thanks!

On Sun, Feb 27, 2011 at 05:13:25PM +0300, Dan Carpenter wrote:
> In the original code, if "device_enum" was NULL then it would
> dereference it when it printed the error message.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Acked-by: Mattia Dongili <malattia@linux.it>

> ---
> v2:  Fixed the error message.
> 
> diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
> index 0db9049..c24aa4a 100644
> --- a/drivers/platform/x86/sony-laptop.c
> +++ b/drivers/platform/x86/sony-laptop.c
> @@ -1311,7 +1311,11 @@ static void sony_nc_rfkill_setup(struct acpi_device *device)
>  	}
>  
>  	device_enum = (union acpi_object *) buffer.pointer;
> -	if (!device_enum || device_enum->type != ACPI_TYPE_BUFFER) {
> +	if (!device_enum) {
> +		pr_err(DRV_PFX "No SN06 return object.");
> +		goto out_no_enum;
> +	}
> +	if (device_enum->type != ACPI_TYPE_BUFFER) {
>  		pr_err(DRV_PFX "Invalid SN06 return object 0x%.2x\n",
>  				device_enum->type);
>  		goto out_no_enum;
> 
-- 
mattia
:wq!

      reply	other threads:[~2011-02-27 21:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-26 12:56 [patch 4/4] sony-laptop: potential null dereference Dan Carpenter
2011-02-27 12:20 ` Mattia Dongili
2011-02-27 14:13   ` [patch 4/4 v2] " Dan Carpenter
2011-02-27 21:06     ` Mattia Dongili [this message]

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=20110227210606.GG29319@kamineko.org \
    --to=malattia@linux.it \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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