X86 platform drivers
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: joeyli.kernel@gmail.com
Cc: platform-driver-x86@vger.kernel.org
Subject: re: acer-wmi: fix obj is NULL but dereferenced
Date: Mon, 7 Jan 2013 14:32:11 +0300	[thread overview]
Message-ID: <20130107113210.GA29782@elgon.mountain> (raw)

Hello Lee, Chun-Yi,

The patch 727651bf738b: "acer-wmi: fix obj is NULL but dereferenced" 
from Dec 14, 2012, leads to the following warning:
drivers/platform/x86/acer-wmi.c:1227 WMID_set_capabilities()
	 warn: calling kfree() when 'out.pointer' is always NULL.

  1217          obj = (union acpi_object *) out.pointer;
  1218          if (obj) {
  1219                  if (obj->type == ACPI_TYPE_BUFFER &&
  1220                          (obj->buffer.length == sizeof(u32) ||
  1221                          obj->buffer.length == sizeof(u64))) {
  1222                          devices = *((u32 *) obj->buffer.pointer);
  1223                  } else if (obj->type == ACPI_TYPE_INTEGER) {
  1224                          devices = (u32) obj->integer.value;
  1225                  }
  1226          } else {
  1227                  kfree(out.pointer);
  1228                  return AE_ERROR;
  1229          }

I was going to remove the kfree() but looking the patch which introduced
it causes GCC warnings and so there is some other stuff which needs to
be fixed as well.

regards,
dan carpenter

             reply	other threads:[~2013-01-07 11:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 11:32 Dan Carpenter [this message]
2013-02-19  4:35 ` acer-wmi: fix obj is NULL but dereferenced joeyli

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=20130107113210.GA29782@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=joeyli.kernel@gmail.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