Commit 62ccfd0f authored by Patrick Mochel's avatar Patrick Mochel

driver model: check return of get_device() when creating a driverfs file.

parent c7a01052
......@@ -90,8 +90,7 @@ int device_create_file(struct device * dev, struct device_attribute * entry)
{
int error = -EINVAL;
if (dev) {
get_device(dev);
if (get_device(dev)) {
error = driverfs_create_file(&entry->attr,&dev->dir);
put_device(dev);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment