block/rnbd-clt: Fix possible memleak
stable inclusion from stable-5.10.4 commit 1b75aea3e360f5e660612b6c25a54cb16c313b23 bugzilla: 46903 -------------------------------- [ Upstream commit 46067844 ] In error case, we do not free the memory for blk_symlink_name. Do it by free the memory in error case, and set to NULL afterwards. Also fix the condition in rnbd_clt_remove_dev_symlink. Fixes: 64e8a6ec ("block/rnbd-clt: Dynamically alloc buffer for pathname & blk_symlink_name") Signed-off-by: NJack Wang <jinpu.wang@cloud.ionos.com> Reviewed-by: NMd Haris Iqbal <haris.iqbal@cloud.ionos.com> Signed-off-by: NJens Axboe <axboe@kernel.dk> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Showing
想要评论请 注册 或 登录