Received: by 2002:ab2:6816:0:b0:1f8:1780:a4ed with SMTP id t22csp21251lqo; Thu, 9 May 2024 10:06:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQh5WOKNSXzorOTyQtgSkW040YH3T39P3vByGGMdNU/QSCfZs81KPxpiijcsjmlAdkuAwq4lgsOZjtlzrf6tIJUt6Vztq8+rY50elz6g== X-Google-Smtp-Source: AGHT+IEdPiXn6XESk0jbWR9Accf65AS5pt7DRQqhD57cKTIRCcqJQYX15KcEidsLa+dzei3zLGgf X-Received: by 2002:a05:620a:21c2:b0:792:a37c:656c with SMTP id af79cd13be357-792c75ad056mr8035285a.40.1715274369009; Thu, 09 May 2024 10:06:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715274368; cv=pass; d=google.com; s=arc-20160816; b=Ez7ALDGkQi8rdAUQapWfc2YFxWhhilN1rBYdppuHRz2mG/kb8vU5h3I7xoW3YfGSEw bvSXpQQtZ5W8+voIPSQA+3LekyLlc1fVFGuSEclAwh2nFXMGGgubABmCOkEy9jFRbXJP rHw4tDelzL3kKXKtf+0nnkBKfWib6Es1M+TGatSCs5WqpwuXGH1XYWquwrLxHQ+JH0in UN2zye4DwHDTcP4RVOCF7vhmDQbvouVWf/pCl1SfcHertCssnoRd7N0aGfE6jh2KLyMx 55n+KvxGhk6wq36BM6+wcyT0BO3DS3Tq/n6ORkxLu1/uEiL53Qht0MCLbwgNTjd3Ws4J nF/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=LEqKDH2sBB2nta/Np1zrw7eWT1wxg9AR95my7CM8l+g=; fh=cB+lPAJ71YwCi8JKCknoMpGvii7OkhcKDwOArN35Z8Y=; b=iz95YXCQoymMO+jQCWZEQuAdNC22Y0mE/1eyhCR/AeY+hKXjdJveMJff3XAVbfAZtG MuukhzD38Gdygy2mGQsQ3ZkGkGkDxZN5lQXo/o3OCk+45V5F4xNjMOZXbJpEsAeQhrjA vAVkiJ3YHV4WyQhcq23TKu7fAAhH2cWf9IVSWhyXE57NWdl2opnjHaGnuH9pOUrll82u GYe9i5gQ/olXnB40B6Q51XJY1iHW15iSnR+cyLgIgsmtj100d5vJoAoLCZFrOiK1UlW4 sRj5r8aCycOo/jWFF7sfjs6rixM9jynZMea3kgqp64Z05r6C93GH0hX74Ts+IXgeCIgX 6R1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Tx4+7vB6; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-174713-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174713-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf362225si161833885a.568.2024.05.09.10.06.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 10:06:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174713-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Tx4+7vB6; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-174713-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174713-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9920B1C20B9F for ; Thu, 9 May 2024 17:06:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82F4BC8E2; Thu, 9 May 2024 17:06:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Tx4+7vB6" Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 281AC8F49 for ; Thu, 9 May 2024 17:05:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715274359; cv=none; b=qUzY05qSTuWOWMFxPrBidwJFA1Qr18CYQa7n6BQUSX/44FAoNFP/+hZVDc7yi51OurmjL3IK+K9N9pgy6K9gQALrZNc6h/g4QDtS3/uI478PQDq6mYoQeoTanPVWoFyas+QWjTIwL7r9j21XUuWi4g5bhdQO1F3ZAvtvq8h1pl0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715274359; c=relaxed/simple; bh=Q3sNmdeS94+C7MoS3NvxvgzpS/Bh9LDxSVr4O7edpcQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=c99tw9C/7p+87VEsWH2qnuL/D5+n8nzUuHKVOEH2ehV/0PlhHrT7i+4H06TGF0/l87jdUwmg4GO1QYYbYRPW2R1xOyr1MEEDukPZ03U2jiP+y+PQYdjm/Zp5MxedCPCeVnPWtn0oLpgfRr2A9lDt/pLhZn19x8ITqMRXCO8Tpbw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Tx4+7vB6; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-69b6d36b71cso7653596d6.3 for ; Thu, 09 May 2024 10:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715274357; x=1715879157; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=LEqKDH2sBB2nta/Np1zrw7eWT1wxg9AR95my7CM8l+g=; b=Tx4+7vB6wQEtC8mkor3dgYA7bIgMzBUFsyzNW6JjheuC7WkXikEXwBteoG3+Y1FEth cutjC+1a1nMwIJZDXrT7OB7+SlLkPKx005h7Hdog9Y0HROBYrn3EqTuGVbiLgQhRdXRI Xn2P7DAwkW27T9eC3ZfKRoVZs93RtbtxEZwnU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715274357; x=1715879157; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LEqKDH2sBB2nta/Np1zrw7eWT1wxg9AR95my7CM8l+g=; b=AWq2L+czaLNkA7Y6IjKBA8G8ikahJtx6s7dloF/8OfEdQbJCtA8QUCosAztK9YHHB9 CvsskzLdsK2p6u+8SM4J/0O0cvHBlXmbc7aOYNQU0ktQm/RmoLYN8eM2ZnyzqsdlLxgg 02Vh27Tayb+fofICYPJtTd0BpTzlcuwF6tW3GAbEgFjbgoRdsWOzMY6VVUxlRSjnkW0p VsrzDTHPR5a0sPL1xvHDzTusuRaHO7mmPd+l6oIYcwMI41ea2ip71fjyT8bb2LGEl9Gk 7OECitIkxVfmeToE/vXY38TT/maiCCtksZyqhkAfuEUv7FxM/7d1ZvUlYNxKDlWAzz58 i/2w== X-Forwarded-Encrypted: i=1; AJvYcCWo8ecLRtW1CEMhHI+UuCWK53U2LMTNPwppDf1xI5NSZ8Y7vC7QhkRgMEEfgbvmik0MTgVEQl8gTAjTRyPWAsoa7GsDMHtp/oPFYLrN X-Gm-Message-State: AOJu0YyCrHtEveAv/9jMf6ClcF+60f4nf3XKg/rWZ52fJy2QnT1TXtNh M+McGBqrmA2VVJj1Tf4GF54HvfmY/lT8CYqoD1hEY+vuAmrjJ4C6FISb+H8UnQ== X-Received: by 2002:ad4:5aea:0:b0:6a0:d4dd:cb44 with SMTP id 6a1803df08f44-6a1515c7de8mr76797036d6.62.1715274356893; Thu, 09 May 2024 10:05:56 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6a15f194945sm8623726d6.61.2024.05.09.10.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 10:05:56 -0700 (PDT) From: Ricardo Ribalda Date: Thu, 09 May 2024 17:05:55 +0000 Subject: [PATCH] media: i2c: hi846: Fix V4L2_SUBDEV_FORMAT_TRY get_selection() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240509-fix-hi846-v1-1-1e19dc517be1@chromium.org> X-B4-Tracking: v=1; b=H4sIAHICPWYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDUwNL3bTMCt2MTAsTM91k4xRzc3MzCzMjo1QloPqColSgJNis6NjaWgB MN32WWwAAAA== To: Sakari Ailus , Martin Kepplinger , Mauro Carvalho Chehab , Pavel Machek Cc: Mauro Carvalho Chehab , Laurent Pinchart , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.12.4 The current code does not return anything to the user. Although the code looks a bit dangerous (using a pointer without checking if it is valid), it should be fine. The code validates that sel->pad has a valid value. Fix the following smatch error: drivers/media/i2c/hi846.c:1854 hi846_get_selection() warn: statement has no effect 31 Fixes: e8c0882685f9 ("media: i2c: add driver for the SK Hynix Hi-846 8M pixel camera") Signed-off-by: Ricardo Ribalda --- While running media-ci on the last patches there was a new sparse warning: https://gitlab.freedesktop.org/linux-media/users/patchwork/-/jobs/58524338/artifacts/external_file/junit/test-smatch.log.txt --- drivers/media/i2c/hi846.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/hi846.c b/drivers/media/i2c/hi846.c index 9c565ec033d4..52d9ca68a86c 100644 --- a/drivers/media/i2c/hi846.c +++ b/drivers/media/i2c/hi846.c @@ -1851,7 +1851,7 @@ static int hi846_get_selection(struct v4l2_subdev *sd, mutex_lock(&hi846->mutex); switch (sel->which) { case V4L2_SUBDEV_FORMAT_TRY: - v4l2_subdev_state_get_crop(sd_state, sel->pad); + sel->r = *v4l2_subdev_state_get_crop(sd_state, sel->pad); break; case V4L2_SUBDEV_FORMAT_ACTIVE: sel->r = hi846->cur_mode->crop; --- base-commit: 48259b90973718d2277db27b5e510f0fe957eaa0 change-id: 20240509-fix-hi846-c3d77768622e Best regards, -- Ricardo Ribalda