Skip to content

Commit

Permalink
s390/cio: derive cdev information only for IO-subchannels
Browse files Browse the repository at this point in the history
[ Upstream commit 0c3812c ]

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>
Stable-dep-of: 1b60741 ("s390/cio: fix out-of-bounds access on cio_ignore free")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
vneethv authored and gregkh committed Nov 10, 2022
1 parent c64be93 commit c65cc56
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/s390/cio/css.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c65cc56

Please sign in to comment.