1
0
Fork 0
alistair23-linux/drivers/s390
Stefan Haberland ee6f0605e0 s390/dasd: fix memleak in path handling error case
[ Upstream commit 00b39f698a ]

If for whatever reason the dasd_eckd_check_characteristics() function
exits after at least some paths have their configuration data
allocated those data is never freed again. In the error case the
device->private pointer is set to NULL and dasd_eckd_uncheck_device()
will exit without freeing the path data because of this NULL pointer.

Fix by calling dasd_eckd_clear_conf_data() for error cases.

Also use dasd_eckd_clear_conf_data() in dasd_eckd_uncheck_device()
to avoid code duplication.

Reported-by: Qian Cai <cai@lca.pw>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-12 12:21:43 +01:00
..
block s390/dasd: fix memleak in path handling error case 2020-01-12 12:21:43 +01:00
char s390 updates for the 5.4 merge window 2019-09-17 14:04:43 -07:00
cio s390/dasd/cio: Interpret ccw_device_get_mdc return value correctly 2020-01-12 12:21:43 +01:00
crypto s390/zcrypt: handle new reply code FILTERED_BY_HYPERVISOR 2020-01-04 19:18:27 +01:00
net s390/qeth: return proper errno on IO error 2019-11-20 12:29:47 -08:00
scsi scsi: zfcp: trace channel log even for FCP command responses 2019-12-17 19:55:26 +01:00
virtio virtio/s390: fix race on airq_areas[] 2019-07-26 13:36:18 +02:00
Makefile s390: remove pointless drivers-y in drivers/s390/Makefile 2019-09-16 13:21:51 +02:00