mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 10:37:47 +00:00
[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>
This commit is contained in:
parent
9f737633e6
commit
25a2001a28
@ -76,7 +76,7 @@ struct tape_class_device *register_tape_dev(
|
|||||||
device,
|
device,
|
||||||
"%s", tcd->device_name
|
"%s", tcd->device_name
|
||||||
);
|
);
|
||||||
rc = PTR_ERR(tcd->class_device);
|
rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0;
|
||||||
if (rc)
|
if (rc)
|
||||||
goto fail_with_cdev;
|
goto fail_with_cdev;
|
||||||
rc = sysfs_create_link(
|
rc = sysfs_create_link(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user