]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
s390/cio: fix a memleak in css_alloc_subchannel
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 21 Sep 2023 07:14:12 +0000 (15:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 09:59:03 +0000 (11:59 +0200)
commita73c8d71693838f5c258aa985d3654b2cf6c987c
tree570c2ca4f650f93d0687964ebc19713159f2ff17
parentc8b6c2df1e7dad147b3bc2fa18800f69da0e8841
s390/cio: fix a memleak in css_alloc_subchannel

commit 63e8b94ad1840f02462633abdb363397f56bc642 upstream.

When dma_set_coherent_mask() fails, sch->lock has not been
freed, which is allocated in css_sch_create_locks(), leading
to a memleak.

Fixes: 4520a91a976e ("s390/cio: use dma helpers for setting masks")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Message-Id: <20230921071412.13806-1-dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/linux-s390/bd38baa8-7b9d-4d89-9422-7e943d626d6e@linux.ibm.com/
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/s390/cio/css.c