From: Dan Carpenter <error27@gmail.com>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] ACPI: use after free in acpi_battery_add()
Date: Tue, 29 Mar 2011 03:12:10 +0000 [thread overview]
Message-ID: <20110329031210.GA9856@bicker> (raw)
"battery" was dereferenced on the error path here.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index fcc13ac..cfc7a5b 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -988,6 +988,7 @@ static int acpi_battery_add(struct acpi_device *device)
acpi_battery_remove_fs(device);
#endif
kfree(battery);
+ return result;
}
battery->pm_nb.notifier_call = battery_notify;
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] ACPI: use after free in acpi_battery_add()
Date: Tue, 29 Mar 2011 06:12:10 +0300 [thread overview]
Message-ID: <20110329031210.GA9856@bicker> (raw)
"battery" was dereferenced on the error path here.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index fcc13ac..cfc7a5b 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -988,6 +988,7 @@ static int acpi_battery_add(struct acpi_device *device)
acpi_battery_remove_fs(device);
#endif
kfree(battery);
+ return result;
}
battery->pm_nb.notifier_call = battery_notify;
next reply other threads:[~2011-03-29 3:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-29 3:12 Dan Carpenter [this message]
2011-03-29 3:12 ` [patch] ACPI: use after free in acpi_battery_add() Dan Carpenter
2011-06-16 19:18 ` Dan Carpenter
2011-06-16 19:18 ` Dan Carpenter
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=20110329031210.GA9856@bicker \
--to=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.