s390/cio: check the subchannel validity for dev_busid
Subsystems (2)
Vineeth Vijayan
maintainerPATCH 1/1 s390/cio: check the subchannel validity for dev_busid
Check the validity of subchanel before reading other fields in the schib.
Fixes d3683c055212 ("s390/cio: add dev_busid sysfs entry for each subchannel")
Reported-by Cornelia Huck <[email protected]>
Signed-off-by Vineeth Vijayan <[email protected]>
--- drivers/s390/cio/css.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/cio/css.c +2 -2
@@ -437,8 +437,8 @@ static ssize_t dev_busid_show(struct device *dev,struct subchannel *sch =to_subchannel (dev);struct pmcw *pmcw = &sch->schib.pmcw; -if ((pmcw->st ==SUBCHANNEL_TYPE_IO || - pmcw->st ==SUBCHANNEL_TYPE_MSG ) && pmcw->dnv) +if ((pmcw->st ==SUBCHANNEL_TYPE_IO && pmcw->dnv) || + (pmcw->st ==SUBCHANNEL_TYPE_MSG && pmcw->w))return sysfs_emit (buf,"0.%x.%04x\n" , sch->schid.ssid, pmcw->dev);else
Signature · 1 line
2.25.1
Quoted 9 lines · Vineeth Vijayan
Check the validity of subchanel before reading other fields in the schib.
Fixes d3683c055212 ("s390/cio: add dev_busid sysfs entry for each subchannel")Reported-by Cornelia Huck <[email protected]>Signed-off-by Vineeth Vijayan <[email protected]>--- drivers/s390/cio/css.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by Cornelia Huck <[email protected]>