linux/drivers/s390/block
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
..
Kconfig
Makefile
dasd.c
dasd_3990_erp.c
dasd_alias.c
dasd_devmap.c
dasd_diag.c
dasd_diag.h
dasd_eckd.c s390/dasd: fix memleak in path handling error case 2020-01-12 12:21:43 +01:00
dasd_eckd.h
dasd_eer.c
dasd_erp.c
dasd_fba.c
dasd_fba.h
dasd_genhd.c
dasd_int.h
dasd_ioctl.c
dasd_proc.c
dcssblk.c
scm_blk.c
scm_blk.h
scm_drv.c
xpram.c