Message ID | 20240211150644.3642-1-d.dulov@aladdin.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-60812-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1967162dyd; Sun, 11 Feb 2024 07:07:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW5hbgv+eFqkHebns1jiIYwo+JegDJavUy31GrtY1Xg67yU+kwL2Y0Ab303YJ+SM/sJTnt8kDVUqOn0n5ZQ3v3BLWK9tg== X-Google-Smtp-Source: AGHT+IGpaObJZOSLQQUnWRyQL2aqcLPO0xGg3hWvvLI/TidxaUMzGt0Xwk7PctrESiOzd1mpjubz X-Received: by 2002:a2e:7308:0:b0:2d0:c94b:f924 with SMTP id o8-20020a2e7308000000b002d0c94bf924mr2785222ljc.6.1707664037605; Sun, 11 Feb 2024 07:07:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707664037; cv=pass; d=google.com; s=arc-20160816; b=kr/PepK4IxyOIImsVt5Dc7mZ//5wr9h+fA69mbe8hcrFvA6ZRsn/q1gjVEjd2XlklW 962rkJwX8ECwbcYTwgxBGOCGIe7KELgGgQ+9hsv2p1Hz6VuO3G20VP0XzfGVZcNBkKZ0 YtJSKG+pGcWHWywL8kgE4CprDc+bLHbd1qL6RnSt4m/R+JMpyKJW7NW+7IpdcEFygHxb g6k+Sby7HCqB+iNEfiWChlJXfFBfUzAO4+Yf3yqgYyTDV/yYAYaOOg6IDjNo7+S03KhB LGD4KLn7yl94cG7iAeKdTYxY4lNwKlxRzXwHPbng0NFuwmlQL9gdbcrBedaOPp0neQpz xRAQ== 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=6rHTltA58xQcnyrbLz6tX1MnyOTsFHf41XXrArVpjd0=; b=TtQpa9qqCoz4A8Az6zLrwHhW1Zs/+70fOzvgatAjBI6Z6NXj313B5HpKzM7E9yCxLK 5+vvpch3pNyDbnGWiAWyc4JVSHd6mpNGvRJVfAflLQSjpoZrsMzjdWww4kxnFp7G9CoW shSy4tqQ/eIP+tUJRjBJsfhVnW5kz2nHCtDpFJpGuVc/k5yJQt3ecNSEyo7V9B6hZeE4 39SbM2gADakDAMqC9TPhNyto75H/qBEVqHNKWz0Naob0qI4L7MXAM9qf59gICSbkt2pN Fl8UvBZmWiK9I2fve+R+OUNDONdTDC7F3ch+3jbHckT4125/QC3Hpt+zbIu8LEyd8tog sNrg==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60812-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru X-Forwarded-Encrypted: i=2; AJvYcCWso8Ho84vbf5erE7UrddZDXEe7wfaEl8zOZJro6v1ikFkEsX/OKwF08NA5OvwcOyEpUHMkfKyaEE0SLZ7NM7T/EReB3g== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u9-20020a056402064900b00561402025e1si1909042edx.539.2024.02.11.07.07.17 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 07:07:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60812-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60812-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 111EB1F21628 for <ouuuleilei@gmail.com>; Sun, 11 Feb 2024 15:07:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 041BD5B68F; Sun, 11 Feb 2024 15:06:58 +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 <d.dulov@aladdin.ru> To: Hans Verkuil <hverkuil@xs4all.nl> CC: Daniil Dulov <d.dulov@aladdin.ru>, Mauro Carvalho Chehab <mchehab@kernel.org>, <linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <lvc-project@linuxtesting.org> 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> 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) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790615525742853667 X-GMAIL-MSGID: 1790615525742853667 |
Series |
media: cx2341x: Check return value of cx2341x_api()
|
|
Commit Message
Daniil Dulov
Feb. 11, 2024, 3:06 p.m. UTC
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 <d.dulov@aladdin.ru>
---
drivers/media/common/cx2341x.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
On 11/02/2024 16:06, Daniil Dulov wrote: > 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 <d.dulov@aladdin.ru> > --- > 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; Indentation is all over the place, please fix! Regards, Hans > > if (!old || > CMP_FIELD(old, new, is_50hz)) {
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)) {