driver core: kmalloc() failure check in driver_probe_device

driver_probe_device() is missing kmalloc() failure check.

Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Akinobu Mita 2006-10-09 18:04:30 +09:00 • committed by Greg Kroah-Hartman
commit 4d66423820

View 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;