mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-17 11:25:04 +08:00
s390/cio: check the subchannel validity for dev_busid
commita4751f157c
upstream. Check the validity of subchanel before reading other fields in the schib. Fixes:d3683c0552
("s390/cio: add dev_busid sysfs entry for each subchannel") CC: <stable@vger.kernel.org> Reported-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Link: https://lore.kernel.org/r/20211105154451.847288-1-vneethv@linux.ibm.com Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
32f71f3680
commit
f33bf6015e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user