diff options
Diffstat (limited to 'drivers/s390/block/dasd_devmap.c')
-rw-r--r-- | drivers/s390/block/dasd_devmap.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index 4cac5b54f26a..d49766f3b940 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c | |||
@@ -874,12 +874,19 @@ dasd_discipline_show(struct device *dev, struct device_attribute *attr, | |||
874 | ssize_t len; | 874 | ssize_t len; |
875 | 875 | ||
876 | device = dasd_device_from_cdev(to_ccwdev(dev)); | 876 | device = dasd_device_from_cdev(to_ccwdev(dev)); |
877 | if (!IS_ERR(device) && device->discipline) { | 877 | if (IS_ERR(device)) |
878 | goto out; | ||
879 | else if (!device->discipline) { | ||
880 | dasd_put_device(device); | ||
881 | goto out; | ||
882 | } else { | ||
878 | len = snprintf(buf, PAGE_SIZE, "%s\n", | 883 | len = snprintf(buf, PAGE_SIZE, "%s\n", |
879 | device->discipline->name); | 884 | device->discipline->name); |
880 | dasd_put_device(device); | 885 | dasd_put_device(device); |
881 | } else | 886 | return len; |
882 | len = snprintf(buf, PAGE_SIZE, "none\n"); | 887 | } |
888 | out: | ||
889 | len = snprintf(buf, PAGE_SIZE, "none\n"); | ||
883 | return len; | 890 | return len; |
884 | } | 891 | } |
885 | 892 | ||