public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: akpm-3NddpPZAyC0@public.gmane.org
To: len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	akpm-3NddpPZAyC0@public.gmane.org,
	panagiotis.issaris-hfxpx0nnwYVX2QMWbMbClIble9XqW/aP@public.gmane.org,
	takis-8nu/KwtRnEU@public.gmane.org
Subject: [patch 2/4] acpi: Toshiba failure handling
Date: Wed, 30 Mar 2005 13:16:49 -0800	[thread overview]
Message-ID: <200503302116.j2ULGc4Y027730@shell0.pdx.osdl.net> (raw)


From: "Panagiotis Issaris" <panagiotis.issaris-hfxpx0nnwYVX2QMWbMbClIble9XqW/aP@public.gmane.org>

Adds the missing failure handling for a kmalloc in the Toshiba ACPI driver.

Signed-off-by: Panagiotis Issaris <takis-8nu/KwtRnEU@public.gmane.org>
Signed-off-by: Andrew Morton <akpm-3NddpPZAyC0@public.gmane.org>
---

 25-akpm/drivers/acpi/toshiba_acpi.c |    3 +++
 1 files changed, 3 insertions(+)

diff -puN drivers/acpi/toshiba_acpi.c~acpi-toshiba-failure-handling drivers/acpi/toshiba_acpi.c
--- 25/drivers/acpi/toshiba_acpi.c~acpi-toshiba-failure-handling	Wed Mar 30 13:16:02 2005
+++ 25-akpm/drivers/acpi/toshiba_acpi.c	Wed Mar 30 13:16:02 2005
@@ -263,6 +263,9 @@ dispatch_write(struct file* file, const 
 	 * destination so that sscanf can be used on it safely.
 	 */
 	tmp_buffer = kmalloc(count + 1, GFP_KERNEL);
+	if(!tmp_buffer)
+		return -ENOMEM;
+
 	if (copy_from_user(tmp_buffer, buffer, count)) {
 		result = -EFAULT;
 	}
_


-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30

             reply	other threads:[~2005-03-30 21:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-30 21:16 akpm-3NddpPZAyC0 [this message]
     [not found] ` <200503302116.j2ULGc4Y027730-bipKiLWnuIsyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
2005-03-31  3:17   ` [patch 2/4] acpi: Toshiba failure handling Len Brown
  -- strict thread matches above, loose matches on Subject: below --
2005-04-05  6:57 akpm-3NddpPZAyC0

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=200503302116.j2ULGc4Y027730@shell0.pdx.osdl.net \
    --to=akpm-3nddppzayc0@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=panagiotis.issaris-hfxpx0nnwYVX2QMWbMbClIble9XqW/aP@public.gmane.org \
    --cc=takis-8nu/KwtRnEU@public.gmane.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