public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: akinobu.mita@gmail.com (Akinobu Mita)
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH] driver core: kmalloc() failure check
Date: Mon, 9 Oct 2006 18:04:30 +0900	[thread overview]
Message-ID: <20061009090430.GA6209@localhost> (raw)

driver_probe_device() is missing kmalloc() failure check.

Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

 drivers/base/dd.c |    2 ++
 1 file changed, 2 insertions(+)

Index: work-fault-inject/drivers/base/dd.c
===================================================================
--- work-fault-inject.orig/drivers/base/dd.c	2006-10-09 15:06:35.000000000 +0900
+++ work-fault-inject/drivers/base/dd.c	2006-10-09 15:09:07.000000000 +0900
@@ -171,6 +171,8 @@ int driver_probe_device(struct device_dr
 		 drv->bus->name, dev->bus_id, drv->name);
 
 	data = kmalloc(sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
 	data->drv = drv;
 	data->dev = dev;
 

                 reply	other threads:[~2006-10-09  9:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20061009090430.GA6209@localhost \
    --to=akinobu.mita@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@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