aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/tape_class.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-07-31 08:59:59 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-07-31 08:59:59 -0400
commitb1b934d31d8a608fe69fc56d6e539548b55b0601 (patch)
treee8206589759c732a3a9b70b3feeb9ef50dc3c6b3 /drivers/s390/char/tape_class.c
parent5dd9feafb351a8bf304292623cbc63335c34d279 (diff)
parentb6ff50833ad43a8ebd9b16bf53c334f7aaf33c41 (diff)
downloadkernel_samsung_crespo-b1b934d31d8a608fe69fc56d6e539548b55b0601.zip
kernel_samsung_crespo-b1b934d31d8a608fe69fc56d6e539548b55b0601.tar.gz
kernel_samsung_crespo-b1b934d31d8a608fe69fc56d6e539548b55b0601.tar.bz2
Merge branch 'master'
Diffstat (limited to 'drivers/s390/char/tape_class.c')
-rw-r--r--drivers/s390/char/tape_class.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c
index a5c68e6..643b6d0 100644
--- 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
);
- sysfs_create_link(
+ rc = PTR_ERR(tcd->class_device);
+ if (rc)
+ goto fail_with_cdev;
+ rc = sysfs_create_link(
&device->kobj,
&tcd->class_device->kobj,
tcd->mode_name
);
+ if (rc)
+ goto fail_with_class_device;
return tcd;
+fail_with_class_device:
+ class_device_destroy(tape_class, tcd->char_device->dev);
+
fail_with_cdev:
cdev_del(tcd->char_device);