mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
s390/cio: check the subchannel validity for dev_busid
commit a4751f157c194431fae9e9c493f456df8272b871 upstream.
Check the validity of subchanel before reading other fields in
the schib.
Fixes: d3683c055212 ("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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
b0989ae51d
commit
5ef14af166
1 changed files with 2 additions and 2 deletions
|
|
@ -433,8 +433,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
|
||||
|
|
|
|||
Loading…
Reference in a new issue