public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390/cio: check the subchannel validity for dev_busid
@ 2021-11-05 15:44 Vineeth Vijayan
  2021-11-05 15:56 ` Cornelia Huck
  0 siblings, 1 reply; 2+ messages in thread
From: Vineeth Vijayan @ 2021-11-05 15:44 UTC (permalink / raw)
  To: cohuck, linux-s390; +Cc: oberpar, vneethv

Check the validity of subchanel before reading other fields in
the schib.

Fixes: d3683c055212 ("s390/cio: add dev_busid sysfs entry for each subchannel")
Reported-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
---
 drivers/s390/cio/css.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 2bc55ccf3f23..ce9e7517430f 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -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
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] s390/cio: check the subchannel validity for dev_busid
  2021-11-05 15:44 [PATCH] s390/cio: check the subchannel validity for dev_busid Vineeth Vijayan
@ 2021-11-05 15:56 ` Cornelia Huck
  0 siblings, 0 replies; 2+ messages in thread
From: Cornelia Huck @ 2021-11-05 15:56 UTC (permalink / raw)
  To: Vineeth Vijayan, linux-s390; +Cc: oberpar, vneethv

On Fri, Nov 05 2021, Vineeth Vijayan <vneethv@linux.ibm.com> wrote:

> Check the validity of subchanel before reading other fields in
> the schib.
>
> Fixes: d3683c055212 ("s390/cio: add dev_busid sysfs entry for each subchannel")
> Reported-by: Cornelia Huck <cohuck@redhat.com>
> Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
> ---
>  drivers/s390/cio/css.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Cornelia Huck <cohuck@redhat.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-05 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-05 15:44 [PATCH] s390/cio: check the subchannel validity for dev_busid Vineeth Vijayan
2021-11-05 15:56 ` Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox