mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[S390] cio: fix double free after failed device initialization
If io_subchannel_initialize_dev fails it will release the only reference to the ccw device therefore the caller should not kfree this device since this is done in the release function. Signed-off-by: Sebastian Ott <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
This commit is contained in:
parent
3edf2fb9d8
commit
06739a8ad3
1 changed files with 1 additions and 3 deletions
|
|
@ -772,10 +772,8 @@ static struct ccw_device * io_subchannel_create_ccwdev(struct subchannel *sch)
|
|||
cdev = io_subchannel_allocate_dev(sch);
|
||||
if (!IS_ERR(cdev)) {
|
||||
ret = io_subchannel_initialize_dev(sch, cdev);
|
||||
if (ret) {
|
||||
kfree(cdev);
|
||||
if (ret)
|
||||
cdev = ERR_PTR(ret);
|
||||
}
|
||||
}
|
||||
return cdev;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue