From a5e2383991ee985332854b721ba3e5abbbabf0f2 Mon Sep 17 00:00:00 2001 From: Stefan Weinhuber Date: Wed, 5 Mar 2008 12:37:11 +0100 Subject: [PATCH] [S390] dasd: fix reference counting in display method for proc/dasd/devices Using the /proc/dasd/devices interface leaves the reference counter of alias devices in an inconsistent state. A process that tries to set such a device offline afterwards will hang. The dasd_devices_show function returns immediately for alias devices and this code path was missing a dasd_put_device call. Signed-off-by: Stefan Weinhuber Signed-off-by: Martin Schwidefsky --- drivers/s390/block/dasd_proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c index 28a86f070048..556063e8f7a9 100644 --- a/drivers/s390/block/dasd_proc.c +++ b/drivers/s390/block/dasd_proc.c @@ -62,8 +62,10 @@ dasd_devices_show(struct seq_file *m, void *v) return 0; if (device->block) block = device->block; - else + else { + dasd_put_device(device); return 0; + } /* Print device number. */ seq_printf(m, "%s", device->cdev->dev.bus_id); /* Print discipline string. */ -- 2.20.1