This is a note to let you know that I've just added the patch titled s390/cio: derive cdev information only for IO-subchannels to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: s390-cio-derive-cdev-information-only-for-io-subchan.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 6fef76b403845a2cac730de8e4874d693c4b5c0c Author: Vineeth Vijayan <vneethv@xxxxxxxxxxxxx> Date: Fri Sep 17 15:04:01 2021 +0200 s390/cio: derive cdev information only for IO-subchannels [ Upstream commit 0c3812c347bfb0dc213556a195e79850c55702f5 ] cdev->online for the purge function must not be checked for the non-IO subchannel type. Make sure that we are deriving the cdev only from sch-type SUBCHANNEL_TYPE_IO. Signed-off-by: Vineeth Vijayan <vneethv@xxxxxxxxxxxxx> Reviewed-by: Peter Oberparleiter <oberpar@xxxxxxxxxxxxx> Signed-off-by: Vasily Gorbik <gor@xxxxxxxxxxxxx> Stable-dep-of: 1b6074112742 ("s390/cio: fix out-of-bounds access on cio_ignore free") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index c27809792609..ce9e7517430f 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -792,10 +792,13 @@ static int __unset_online(struct device *dev, void *data) { struct idset *set = data; struct subchannel *sch = to_subchannel(dev); - struct ccw_device *cdev = sch_get_cdev(sch); + struct ccw_device *cdev; - if (cdev && cdev->online) - idset_sch_del(set, sch->schid); + if (sch->st == SUBCHANNEL_TYPE_IO) { + cdev = sch_get_cdev(sch); + if (cdev && cdev->online) + idset_sch_del(set, sch->schid); + } return 0; }