From patchwork Thu Nov 2 14:11:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandra Diupina X-Patchwork-Id: 740883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC98BC41535 for ; Thu, 2 Nov 2023 14:12:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376763AbjKBOMB (ORCPT ); Thu, 2 Nov 2023 10:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235261AbjKBOL6 (ORCPT ); Thu, 2 Nov 2023 10:11:58 -0400 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A56A181; Thu, 2 Nov 2023 07:11:56 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 4B312186ADA3; Thu, 2 Nov 2023 17:11:54 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id osod0Jzcpdur; Thu, 2 Nov 2023 17:11:52 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id D4C7C186AD74; Thu, 2 Nov 2023 17:11:51 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8K7SQe3qp8h8; Thu, 2 Nov 2023 17:11:51 +0300 (MSK) Received: from rbta-msk-lt-302690.astralinux.ru (unknown [10.177.237.131]) by mail.astralinux.ru (Postfix) with ESMTPSA id 575CE186AD85; Thu, 2 Nov 2023 17:11:50 +0300 (MSK) From: Alexandra Diupina To: Jacopo Mondi Cc: Alexandra Diupina , Kieran Bingham , Laurent Pinchart , =?utf-8?q?Nik?= =?utf-8?q?las_S=C3=B6derlund?= , Mauro Carvalho Chehab , Sakari Ailus , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH 3/4] Remove redundant return value check Date: Thu, 2 Nov 2023 17:11:34 +0300 Message-Id: <20231102141135.369-3-adiupina@astralinux.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231102141135.369-1-adiupina@astralinux.ru> References: <20231102141135.369-1-adiupina@astralinux.ru> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- 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)