Loading
media: vidtv: mux: Add check and kfree for kstrdup
stable inclusion from stable-v5.10.201 commit 64863ba8e6b7651d994c6e6d506cc8aa2ac45edb category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9RE9O CVE: CVE-2023-52841 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=64863ba8e6b7651d994c6e6d506cc8aa2ac45edb -------------------------------- [ Upstream commit 1fd6eb12642e0c32692924ff359c07de4b781d78 ] Add check for the return value of kstrdup() and return the error if it fails in order to avoid NULL pointer dereference. Moreover, use kfree() in the later error handling in order to avoid memory leak. Fixes: c2f78f0c ("media: vidtv: psi: add a Network Information Table (NIT)") Signed-off-by:Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Zeng Heng <zengheng4@huawei.com>