Skip to contentSkip to conversation

s390/cio: check the subchannel validity for dev_busid

PATCH In review Vineeth Vijayan 2 participants 2 messages Nov 5, 2021

Subsystems (2)
lore
Share & tools
lore

Vineeth Vijayan

author maintainer
#0 lore raw

PATCH 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")
---
 drivers/s390/cio/css.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/cio/css.c +2 -2
index 2bc55ccf3f23..ce9e7517430f 100644
@@ -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