git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git]
/
drivers
/
s390
/
char
/
tape_class.c
diff --git
a/drivers/s390/char/tape_class.c
b/drivers/s390/char/tape_class.c
index
a5c68e6
..
56b8761
100644
(file)
--- a/
drivers/s390/char/tape_class.c
+++ b/
drivers/s390/char/tape_class.c
@@
-76,14
+76,22
@@
struct tape_class_device *register_tape_dev(
device,
"%s", tcd->device_name
);
device,
"%s", tcd->device_name
);
- sysfs_create_link(
+ rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0;
+ if (rc)
+ goto fail_with_cdev;
+ rc = sysfs_create_link(
&device->kobj,
&tcd->class_device->kobj,
tcd->mode_name
);
&device->kobj,
&tcd->class_device->kobj,
tcd->mode_name
);
+ if (rc)
+ goto fail_with_class_device;
return tcd;
return tcd;
+fail_with_class_device:
+ class_device_destroy(tape_class, tcd->char_device->dev);
+
fail_with_cdev:
cdev_del(tcd->char_device);
fail_with_cdev:
cdev_del(tcd->char_device);