lkml.org 
[lkml]   [2023]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/4] Remove redundant return value check
Date
media_entity_pads_init() will not return 0 only if the
2nd parameter >= MEDIA_ENTITY_MAX_PADS (512), but 1 is
passed, so checking the return value is redundant

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: a59f853b3b4b ("media: i2c: Add driver for RDACM21 camera module")
Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
---
drivers/media/i2c/rdacm21.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c
index 3e22df36354f..168d28073760 100644
--- a/drivers/media/i2c/rdacm21.c
+++ b/drivers/media/i2c/rdacm21.c
@@ -583,9 +583,7 @@ static int rdacm21_probe(struct i2c_client *client)

dev->pad.flags = MEDIA_PAD_FL_SOURCE;
dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
- ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
- if (ret < 0)
- goto error_free_ctrls;
+ media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);

ret = v4l2_async_register_subdev(&dev->sd);
if (ret)
--
2.30.2
\
 
 \ /
  Last update: 2023-11-02 15:13    [W:0.082 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site