From: Heiko Carstens Date: Mon, 7 Aug 2006 15:00:28 +0000 (+0200) Subject: [S390] tape class return value handling. X-Git-Tag: v2.6.18-rc5~126^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25a2001a285e187d99ea347693bedd73b3e0722a;p=linux-2.6 [S390] tape class return value handling. Without this patch register_tape_dev() will always fail, but might return a value that is not an error number. This will lead to accesses to already freed memory areas... Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c index 643b6d0785..56b87618b1 100644 --- a/drivers/s390/char/tape_class.c +++ b/drivers/s390/char/tape_class.c @@ -76,7 +76,7 @@ struct tape_class_device *register_tape_dev( device, "%s", tcd->device_name ); - rc = PTR_ERR(tcd->class_device); + rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0; if (rc) goto fail_with_cdev; rc = sysfs_create_link(