net: qrtr: free memory on error path in radix_tree_insert()
stable inclusion from stable-v5.10.168 commit 0c76eddc1f89c52e197f43a5827a51b36af38c36 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7URR4 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0c76eddc1f89c52e197f43a5827a51b36af38c36 ---------------------------------------------------- commit 29de68c2 upstream. Function radix_tree_insert() returns errors if the node hasn't been initialized and added to the tree. "kfree(node)" and return value "NULL" of node_get() help to avoid using unclear node in other calls. Found by Linux Verification Center (linuxtesting.org) with SVACE. Cc: <stable@vger.kernel.org> # 5.7 Fixes: 0c2204a4 ("net: qrtr: Migrate nameservice to kernel from userspace") Signed-off-by:Natalia Petrova <n.petrova@fintech.ru> Reviewed-by:
Simon Horman <simon.horman@corigine.com> Reviewed-by:
Manivannan Sadhasivam <mani@kernel.org> Link: https://lore.kernel.org/r/20230125134831.8090-1-n.petrova@fintech.ru Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
zhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
Loading
Please sign in to comment