Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39879
b: refs/heads/master
c: a306eea
h: refs/heads/master
i:
  39877: 462edd2
  39875: 06e9b33
  39871: b4866b1
v: v3
  • Loading branch information
Cornelia Huck authored and Greg Kroah-Hartman committed Oct 18, 2006
1 parent a29798b commit 6ce8420
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 513e7337adc32cdfbffecb99953e45a44e812c2d
refs/heads/master: a306eea40952e6365301e8a2f7d5ffa9c6a1921b
10 changes: 7 additions & 3 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,16 @@ int device_add(struct device *dev)
if (dev->driver)
dev->uevent_attr.attr.owner = dev->driver->owner;
dev->uevent_attr.store = store_uevent;
device_create_file(dev, &dev->uevent_attr);
error = device_create_file(dev, &dev->uevent_attr);
if (error)
goto attrError;

if (MAJOR(dev->devt)) {
struct device_attribute *attr;
attr = kzalloc(sizeof(*attr), GFP_KERNEL);
if (!attr) {
error = -ENOMEM;
goto PMError;
goto ueventattrError;
}
attr->attr.name = "dev";
attr->attr.mode = S_IRUGO;
Expand All @@ -450,7 +452,7 @@ int device_add(struct device *dev)
error = device_create_file(dev, attr);
if (error) {
kfree(attr);
goto attrError;
goto ueventattrError;
}

dev->devt_attr = attr;
Expand Down Expand Up @@ -507,6 +509,8 @@ int device_add(struct device *dev)
device_remove_file(dev, dev->devt_attr);
kfree(dev->devt_attr);
}
ueventattrError:
device_remove_file(dev, &dev->uevent_attr);
attrError:
kobject_uevent(&dev->kobj, KOBJ_REMOVE);
kobject_del(&dev->kobj);
Expand Down

0 comments on commit 6ce8420

Please sign in to comment.