diff options
| author | Vineeth Vijayan <vneethv@linux.ibm.com> | 2021-11-05 16:44:51 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-11-17 09:48:50 +0100 |
| commit | 5ef14af166290ddffdeaec16d47b0f8588d56cac (patch) | |
| tree | 8efe81bf513e75fbc4905cf4726d0616e6a7c974 /drivers/s390 | |
| parent | b0989ae51d01b2e86840bed7cd7ca7cc8395c6ca (diff) | |
| download | linux-5ef14af166290ddffdeaec16d47b0f8588d56cac.tar.gz linux-5ef14af166290ddffdeaec16d47b0f8588d56cac.tar.bz2 linux-5ef14af166290ddffdeaec16d47b0f8588d56cac.zip | |
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: <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>
Diffstat (limited to 'drivers/s390')
| -rw-r--r-- | drivers/s390/cio/css.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 7950ac59b174..ad447437a27c 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -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 |
