s390/cio: derive cdev information only for IO-subchannels
authorVineeth Vijayan <vneethv@linux.ibm.com>
Fri, 17 Sep 2021 13:04:01 +0000 (15:04 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 4 Oct 2021 07:49:36 +0000 (09:49 +0200)
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@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/cio/css.c

index 44461928aab8afd3b3042a31c2640d39dec931ee..2bc55ccf3f23729b64b4253b5d5103fd1b9b9d74 100644 (file)
@@ -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;
 }