Skip to content

Commit

Permalink
driver core: kmalloc() failure check in driver_probe_device
Browse files Browse the repository at this point in the history
driver_probe_device() is missing kmalloc() failure check.

Signed-off-by: Akinobu Mita <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
mita authored and gregkh committed Oct 18, 2006
1 parent d9fd4d3 commit 4d66423
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4d66423

Please sign in to comment.