aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/chp.c
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2016-01-25 10:31:33 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-01-26 12:47:41 +0100
commit61f0bfcf8020f02eb09adaef96745d1c1d1b3623 (patch)
treef5e6630a4281f738b2d371f87fad6eb8cb682bfc /drivers/s390/cio/chp.c
parents390/cio: fix measurement characteristics memleak (diff)
downloadlinux-dev-61f0bfcf8020f02eb09adaef96745d1c1d1b3623.tar.xz
linux-dev-61f0bfcf8020f02eb09adaef96745d1c1d1b3623.zip
s390/cio: ensure consistent measurement state
Make sure that in all cases where we could not obtain measurement characteristics the associated fields are set to invalid values. Note: without this change the "shared" capability of a channel path for which we could not obtain the measurement characteristics was incorrectly displayed as 0 (not shared). We will now correctly report "unknown" in this case. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/chp.c')
-rw-r--r--drivers/s390/cio/chp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index 3d2b6c48c18e..8504629cbf72 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -466,14 +466,11 @@ int chp_new(struct chp_id chpid)
ret = -ENODEV;
goto out_free;
}
- /* Get channel-measurement characteristics. */
- if (css_chsc_characteristics.scmc && css_chsc_characteristics.secm) {
- ret = chsc_get_channel_measurement_chars(chp);
- if (ret)
- goto out_free;
- } else {
- chp->cmg = -1;
- }
+
+ ret = chsc_get_channel_measurement_chars(chp);
+ if (ret)
+ goto out_free;
+
dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id);
/* make it known to the system */