]> err.no Git - linux-2.6/commitdiff
driver core: kmalloc() failure check in driver_probe_device
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 9 Oct 2006 09:04:30 +0000 (18:04 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 18 Oct 2006 19:49:56 +0000 (12:49 -0700)
driver_probe_device() is missing kmalloc() failure check.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/dd.c

index ef7db6939cbf05af28bac4ae4bedc298d103214f..db01b95a47a501d5976c04d66052a8809f026f29 100644 (file)
@@ -171,6 +171,8 @@ int driver_probe_device(struct device_driver * drv, struct device * dev)
                 drv->bus->name, dev->bus_id, drv->name);
 
        data = kmalloc(sizeof(*data), GFP_KERNEL);
+       if (!data)
+               return -ENOMEM;
        data->drv = drv;
        data->dev = dev;