Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2002373rdb; Sun, 11 Feb 2024 07:07:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWaYbwqW3thOLAfVlaz520gXtlKhGRk2GABu8VVakrPdkPGDt7tHhHzFf1rXoqNGNFgz+UZr/es/G8OqGiFyWcbY0/L1u8shwkHInKd/Q== X-Google-Smtp-Source: AGHT+IE71AtMynLyPsTXrZI2iR2tImplCIRqywfwHWo/Qxa6TUqHvB+vM/2WEhwEqactjoR+IZNQ X-Received: by 2002:a17:90b:f18:b0:297:a3f:612f with SMTP id br24-20020a17090b0f1800b002970a3f612fmr2044044pjb.14.1707664030855; Sun, 11 Feb 2024 07:07:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707664030; cv=pass; d=google.com; s=arc-20160816; b=UJsKFlcGCZIXKsoA5cI+hI59jCi45jInpMCy8mNHF4jWjABfRPviXIyIFRiQmbt/mx fTWlGw6UFSnW9zUKl2uftW6SFORb8nXeZEkPa6j33FLfxhfDOa4vnFIsL1brBToLrpnM FSr7D9ZGnIoEaDc5FWwqSJSc602/BuPz1r+Y3iik3gaGLoDrhtvk6q7xoxHFn0TvhvUc 4As4VfxrZ79YC9Bw3T+sGIfbUfprBNJHLRTfHrkUVg94FoBXQJV/Lw2ouiZbtTg4yAGQ yvXfxRX8/1WkqYkSDEoEeX3T2Z19fIqBH6o/6S35x7ZpULvVpzXoAVXDPfPPmyAMI1lp jEKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=cTXI00DYyEB2AxwOPV7Dsl4zYH5iSH8uJyh+Pj+05oA=; fh=Co54z0zZTY9fU72WjV+75YclE1KID/CzA3v/CQfiw6Y=; b=BqC1ySgJn4nBnaKWAMDrxL/sQBzJ9diMhlm6Yk/xDqUJJy29uNSrWP/lgw482G39po oqPUQCX6z0D2YDg2Gat9ow4iR+r+SyOFTNtz4GmRsxw8sg0KnW5SrzjB1AXS583QSXJZ UQkloZJmzfXJ5ppfjf8JFF/YDq2QFs217IGUjKF9OAKd4xqiBGT8dW9xjI2plzXKEunp 5Jqsv3/2r+V74DNbn1+Xd38wIU0JyEcQmUFOGrQ5Iw4YYXg62w6z3JshOsi8B7oYi+ZY eMND4yVCruS6rl59vI9n2ooZUk40v8Qntdff67zi4hVGMFc+kV4v5wGTBstwqf7YQfOU fV3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-60812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru X-Forwarded-Encrypted: i=2; AJvYcCUPBo/qa19pMomr3xvdrXBDyGkSMLs8XNXGtwYB/kt2TqxszMSYX29Z/c0jm8RcVRgp40/Ctilb3hJqCGCXvH/7/V5e90AaVHfcR/N9Ig== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id v184-20020a6389c1000000b005dc210489fdsi5081676pgd.63.2024.02.11.07.07.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 07:07:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-60812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5BB8FB2155B for ; Sun, 11 Feb 2024 15:07:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00C5D5B670; Sun, 11 Feb 2024 15:06:57 +0000 (UTC) Received: from mail-out.aladdin-rd.ru (mail-out.aladdin-rd.ru [91.199.251.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E83D5A4C2; Sun, 11 Feb 2024 15:06:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.199.251.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707664016; cv=none; b=HXrMrlAIMO3CbrgsNCgA7vb+vV1R5AE7r+TU1zLHd7/RX1X7Kr5lmgVMBS+9S7kZgVmxKoTKIvELdcLhVTD9blxJmIkUGXxO4LCYf3pqEpByq6VmsIri6RA/l61waU4OFTRnS8EiLqvJm8ymBiNsvMooOcgNjJBeUuynkXXj73c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707664016; c=relaxed/simple; bh=jfXKe5YaiBnAa8P1PhhF6TvpWZj2yZjujLHuQp30l64=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=tV6rKnh62YmfzMv1MkmjnCrkUSLbvxzgct4e4yUCC/qPFsY5GfdNRBpsF8g8S63t4IFCViR4g9TnWm8u3O9iapnu+YJe7qoJwuKbPkZQXXMYrzivrbzYlruv1/xv3XwSOmpko85UGtUu9hae85WQQBWwCdThGECwsj/PjoolOZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru; spf=pass smtp.mailfrom=aladdin.ru; arc=none smtp.client-ip=91.199.251.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aladdin.ru From: Daniil Dulov To: Hans Verkuil CC: Daniil Dulov , Mauro Carvalho Chehab , , , Subject: [PATCH] media: cx2341x: Check return value of cx2341x_api() Date: Sun, 11 Feb 2024 07:06:44 -0800 Message-ID: <20240211150644.3642-1-d.dulov@aladdin.ru> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EXCH-2016-03.aladdin.ru (192.168.1.103) To EXCH-2016-01.aladdin.ru (192.168.1.101) cx2341x_api() may return an error, so add a check. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 45ad9f8b44b0 ("V4L/DVB (4202): allow selecting CX2341x port mode") Signed-off-by: Daniil Dulov --- drivers/media/common/cx2341x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/common/cx2341x.c b/drivers/media/common/cx2341x.c index 1f67e021138f..fa888d7c3988 100644 --- a/drivers/media/common/cx2341x.c +++ b/drivers/media/common/cx2341x.c @@ -1035,7 +1035,10 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func, }; int err; - cx2341x_api(priv, func, CX2341X_ENC_SET_OUTPUT_PORT, 2, new->port, 0); + err = cx2341x_api(priv, func, CX2341X_ENC_SET_OUTPUT_PORT, 2, new->port, 0); + + if (err) + return err; if (!old || CMP_FIELD(old, new, is_50hz)) { -- 2.25.1