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~79^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25a2001a285e187d99ea347693bedd73b3e0722a;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git [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 643b6d0..56b8761 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(