]> git.ipfire.org Git - thirdparty/linux.git/commit
uacce: fix cdev handling in the cleanup path
authorWenkai Lin <linwenkai6@hisilicon.com>
Tue, 2 Dec 2025 06:12:53 +0000 (14:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Jan 2026 15:43:16 +0000 (16:43 +0100)
commita3bece3678f6c88db1f44c602b2a63e84b4040ac
tree55edb381a8e4cd32ea9c1f7ee2dfa8e506d8ce3d
parentbba7fd1258cd72f9a9d9e7d86c155851fff23ae2
uacce: fix cdev handling in the cleanup path

When cdev_device_add fails, it internally releases the cdev memory,
and if cdev_device_del is then executed, it will cause a hang error.
To fix it, we check the return value of cdev_device_add() and clear
uacce->cdev to avoid calling cdev_device_del in the uacce_remove.

Fixes: 015d239ac014 ("uacce: add uacce driver")
Cc: stable@vger.kernel.org
Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Link: https://patch.msgid.link/20251202061256.4158641-2-huangchenghai2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/uacce/uacce.c