summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2024-10-15 09:40:53 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-17 11:36:47 +0100
commitc36b830754ae1dd1db41c27f57b29267878f9702 (patch)
tree94d5a17c427768b36e7795c30b995c37f9b4ab3c /drivers
parent117c3caf2eacebadf6f073a0a9584c9ad955c523 (diff)
downloadlinux-c36b830754ae1dd1db41c27f57b29267878f9702.tar.gz
linux-c36b830754ae1dd1db41c27f57b29267878f9702.tar.bz2
linux-c36b830754ae1dd1db41c27f57b29267878f9702.zip
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/nuvoton/npcm-video.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/platform/nuvoton/npcm-video.c
index 4f5d75645b2b..024cd8ee1709 100644
--- a/drivers/media/platform/nuvoton/npcm-video.c
+++ b/drivers/media/platform/nuvoton/npcm-video.c
@@ -1665,9 +1665,9 @@ static int npcm_video_ece_init(struct npcm_video *video)
dev_info(dev, "Support HEXTILE pixel format\n");
ece_pdev = of_find_device_by_node(ece_node);
- if (IS_ERR(ece_pdev)) {
+ if (!ece_pdev) {
dev_err(dev, "Failed to find ECE device\n");
- return PTR_ERR(ece_pdev);
+ return -ENODEV;
}
of_node_put(ece_node);