All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] s390: tape class return value handling.
@ 2006-08-07 15:05 Martin Schwidefsky
  0 siblings, 0 replies; only message in thread
From: Martin Schwidefsky @ 2006-08-07 15:05 UTC (permalink / raw)
  To: linux-kernel, heiko.carstens

From: Heiko Carstens <heiko.carstens@de.ibm.com>

[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 <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 drivers/s390/char/tape_class.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -urpN linux-2.6/drivers/s390/char/tape_class.c linux-2.6-patched/drivers/s390/char/tape_class.c
--- linux-2.6/drivers/s390/char/tape_class.c	2006-08-07 14:14:29.000000000 +0200
+++ linux-2.6-patched/drivers/s390/char/tape_class.c	2006-08-07 14:14:42.000000000 +0200
@@ -76,7 +76,7 @@ struct tape_class_device *register_tape_
 				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(

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-07 15:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-07 15:05 [patch] s390: tape class return value handling Martin Schwidefsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.