linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Len Brown <lenb@kernel.org>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>,
	Shaohua Li <shaohua.li@intel.com>,
	Zhang Rui <rui.zhang@intel.com>,
	Zhao Yakui <yakui.zhao@intel.com>,
	linux-acpi@vger.kernel.org, vegardno@ifi.uio.no
Subject: [patch] acpi: silence kmemcheck false positive
Date: Thu, 22 Apr 2010 21:43:46 +0200	[thread overview]
Message-ID: <20100422194346.GB29093@bicker> (raw)

This addresses: https://bugzilla.kernel.org/show_bug.cgi?id=14998

We copy some strings into "event" and kmemcheck complains that the bytes 
after the NULL terminators are uninitialized.  That's true but it's
harmless.  The "event" struct is used in acpi_system_read_event() and we
don't read past the terminator.

This patch just silences the warning.

Reported-by: Christian Casteyde <casteyde.christian@free.fr>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Tested-by: Christian Casteyde <casteyde.christian@free.fr>

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 37132dc..4ef7c97 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -527,7 +527,7 @@ int acpi_bus_generate_proc_event4(const char *device_class, const char *bus_id,
 	if (!event_is_open)
 		return 0;
 
-	event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);
+	event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC | __GFP_NOTRACK_FALSE_POSITIVE);
 	if (!event)
 		return -ENOMEM;
 

             reply	other threads:[~2010-04-22 19:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22 19:43 Dan Carpenter [this message]
2010-04-22 20:02 ` [patch] acpi: silence kmemcheck false positive Dan Carpenter
2010-04-22 22:32   ` Bjorn Helgaas
2010-04-23 19:17     ` Dan Carpenter
2010-04-26 22:19     ` Dan Carpenter
2010-04-26 22:23     ` [patch v2] " Dan Carpenter
2010-04-27  7:15       ` Len Brown

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=20100422194346.GB29093@bicker \
    --to=error27@gmail.com \
    --cc=bjorn.helgaas@hp.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=shaohua.li@intel.com \
    --cc=vegardno@ifi.uio.no \
    --cc=yakui.zhao@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).