Skip to content

Commit a4751f1

Browse files
vneethvVasily Gorbik
authored andcommitted
s390/cio: check the subchannel validity for dev_busid
Check the validity of subchanel before reading other fields in the schib. Fixes: d3683c0 ("s390/cio: add dev_busid sysfs entry for each subchannel") CC: <[email protected]> Reported-by: Cornelia Huck <[email protected]> Signed-off-by: Vineeth Vijayan <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 9d48c7a commit a4751f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/s390/cio/css.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ static ssize_t dev_busid_show(struct device *dev,
437437
struct subchannel *sch = to_subchannel(dev);
438438
struct pmcw *pmcw = &sch->schib.pmcw;
439439

440-
if ((pmcw->st == SUBCHANNEL_TYPE_IO ||
441-
pmcw->st == SUBCHANNEL_TYPE_MSG) && pmcw->dnv)
440+
if ((pmcw->st == SUBCHANNEL_TYPE_IO && pmcw->dnv) ||
441+
(pmcw->st == SUBCHANNEL_TYPE_MSG && pmcw->w))
442442
return sysfs_emit(buf, "0.%x.%04x\n", sch->schid.ssid,
443443
pmcw->dev);
444444
else

0 commit comments

Comments
 (0)