]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
remoteproc: pru: Fix potential NULL pointer dereference in pru_rproc_set_ctable()
authorZhen Ni <zhen.ni@easystack.cn>
Tue, 23 Sep 2025 11:21:09 +0000 (19:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2025 10:04:22 +0000 (12:04 +0200)
commitf0164d89950120281f2446be9687cffa1e43dbcc
treea72a208d95f4eddd971092bb193c436ed1384d2c
parent41683624cbff0a26bb7e0627f4a7e1b51a8779a8
remoteproc: pru: Fix potential NULL pointer dereference in pru_rproc_set_ctable()

commit d41e075b077142bb9ae5df40b9ddf9fd7821a811 upstream.

pru_rproc_set_ctable() accessed rproc->priv before the IS_ERR_OR_NULL
check, which could lead to a null pointer dereference. Move the pru
assignment, ensuring we never dereference a NULL rproc pointer.

Fixes: 102853400321 ("remoteproc: pru: Add pru_rproc_set_ctable() function")
Cc: stable@vger.kernel.org
Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
Link: https://lore.kernel.org/r/20250923112109.1165126-1-zhen.ni@easystack.cn
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/remoteproc/pru_rproc.c