]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: nuvoton: Fix an error check in npcm_video_ece_init()
authorZhen Lei <thunder.leizhen@huawei.com>
Tue, 15 Oct 2024 01:40:53 +0000 (09:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Feb 2025 09:05:33 +0000 (10:05 +0100)
commitbdd823b9d068284e1d998b962cfef29236365df3
treeb923e3f81c8d87eb1221109ed1349d39e2eb5df4
parent5100391acad41e4ce0568b2b41787c3827bda225
media: nuvoton: Fix an error check in npcm_video_ece_init()

commit c4b7779abc6633677e6edb79e2809f4f61fde157 upstream.

When function of_find_device_by_node() fails, it returns NULL instead of
an error code. So the corresponding error check logic should be modified
to check whether the return value is NULL and set the error code to be
returned as -ENODEV.

Fixes: 46c15a4ff1f4 ("media: nuvoton: Add driver for NPCM video capture and encoding engine")
Cc: stable@vger.kernel.org
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/r/20241015014053.669-1-thunder.leizhen@huawei.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/nuvoton/npcm-video.c