Revert "s390/cio: Fix device lifecycle handling in css_alloc_subchannel()"
PATCH 1/1 Revert "s390/cio: Fix device lifecycle handling in css_alloc_subchannel()"
This reverts commit 2b2ad7ad4a28ffdb9f94e6d979b88a5b12b71681, which was commit f65c75b0b9b5a390bc3beadcde0a6fbc3ad118f7 upstream. The order of initialisation and error paths in this function are substantially different in 5.10 and this backport did not take that into account.
--- drivers/s390/cio/css.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/cio/css.c +1 -1
@@ -241,7 +241,7 @@ struct subchannel *css_alloc_subchannel(struct subchannel_id schid,return sch; err: -put_device (&sch->dev); +kfree (sch);return ERR_PTR (ret); }
Quoted 6 lines · Ben Hutchings
This reverts commit
2b2ad7ad4a28ffdb9f94e6d979b88a5b12b71681, which was commitf65c75b0b9b5a390bc3beadcde0a6fbc3ad118f7upstream. The order of initialisation and error paths in this function are substantially different in 5.10 and this backport did not take that into account.
Hi Ben,
Thank you for pointing it out.
I overlooked that part. The goto err was all before device_initialize().
Quoted 18 lines
Signed-off-by Ben Hutchings <[email protected]>--- drivers/s390/cio/css.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/s390/cio/css.c +1
-1@@ -241,7 +241,7 @@ struct subchannel *css_alloc_subchannel(struct subchannel_id schid,return sch; err: -put_device (&sch->dev); +kfree (sch);return ERR_PTR (ret); }
Sasha Levin
maintainerQuoted 4 lines · Ben Hutchings
The backported commit calls
put_device()on the embedded struct device, which is now reached ifcss_sch_create_locks()fails, before it was initialised. This effectively reverts upstream commitf65c75b0b9b5for 5.10.
Queued for 5.10, thanks. I also queued matching reverts on 5.15 (of b1d4e6fb24167) and 6.1 (of fd295a75d828c), since the same goto-err path lands at the err: label before device_initialize() on those branches too.
Signature · 2 lines
Thanks, Sasha
Quoted 10 lines · Sasha Levin
Quoted 4 lines · Ben Hutchings
The backported commit calls
put_device()on the embedded struct device, which is now reached ifcss_sch_create_locks()fails, before it was initialised. This effectively reverts upstream commitf65c75b0b9b5for 5.10.Queued for 5.10, thanks. I also queued matching reverts on 5.15 (of
b1d4e6fb24167) and 6.1 (offd295a75d828c), since the same goto-err path lands at the err: label beforedevice_initialize()on those branches too.
Thanks. I am still working my way through various fixes needed for different stable branches. I agree with reverting for exactly those branches too.
Ben.
Signature · 2 lines
Ben Hutchings - Debian developer, member of kernel, installer and LTS teams