Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1700010pxb; Thu, 4 Mar 2021 19:21:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwW+EpfxTW1bd3Cemb23gARObR06OzAoXpk3zra50HX5tqoWkkXRd/O5kGmh8xXUi4suy7 X-Received: by 2002:a17:907:9870:: with SMTP id ko16mr511362ejc.227.1614914465932; Thu, 04 Mar 2021 19:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614914465; cv=none; d=google.com; s=arc-20160816; b=outSzt7weddlEOVuH55y5IinmQ640F7DD88zLCs5ZCKD2x50kS0l+fGTdzKj9pkArc Ad3iJTma7Hz3XL8le7YWjq6Lq01VNXXkOWDTtjmRf7BufVQyX633TJC2Lvstgxsb2pSs jPCnMnPkuYXSu3+MGvHQG34grfSojLl1JPJgJTbOffxDdTTQDB0QMp36oobz8MzBt3DU yZF3Gq6SjqfqIsW+7HeOJ7E2DJm/AZuWpgD5p+hJOKuQq1iAlSYZ26nEn25twTWvpmWJ vN3BI7MYeOfj44vl4RZejCkcF6TpCtno3cUcDhyWmY84plpoD8rTZ9S0oCWXj9v2chjO T+Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=Mmb0AMwY7KA4BBFBr/4WxaBOD6GrsRdVk6XodB+KlyA=; b=dloy7s7BfdyvpeybxhJYXuaIZrbZVELhqTrXrZh2jSuFJIPE23ouiWpja3cR1hSrmI eSVess+zgqkZSJ7uHIiWrZChNxwTKtEVaGSnoI5qaqXkcp9ObYCwiknTEBfxDa9iPf3x /OJ7kQ4JCldmBqtKkS9ev53antQFPgSlN4T4kIPqWiecNzhjoSkCHHBjOR639RFu32/J /NBKf0wTLNX3tdccdBb5nAz9LtBle00lvHM6d/ydLdJUca6w0oMA2j6War121y0fK7TT q/rmSG5t7SK4PTlGgVu57X9igt+GEYnMF1os8YvUIA/wlRLwBcP0wOabUb6e5kUXUVEU co0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GqX8Ibpg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j13si865903edn.369.2021.03.04.19.20.39; Thu, 04 Mar 2021 19:21:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GqX8Ibpg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229528AbhCEDTw (ORCPT + 99 others); Thu, 4 Mar 2021 22:19:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbhCEDTw (ORCPT ); Thu, 4 Mar 2021 22:19:52 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F4171C061574; Thu, 4 Mar 2021 19:19:51 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id d8so648536plg.10; Thu, 04 Mar 2021 19:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Mmb0AMwY7KA4BBFBr/4WxaBOD6GrsRdVk6XodB+KlyA=; b=GqX8IbpgcztRZwSNVZUE9Zpo3hG9IKkkkGwl4CcYO/ezr7+mzmm4SYhgi28UgVcg4D W1t4iyq2zV2+93ucMreym9AgTRJxTqN9iNjFcYWF+0qdCdk1an4/QlUjtJpobeQC4tlQ BZfZ/NcXcbhJGGLx+OKjajv8e6P+/I+ienH1V7JShCws2gcXcAVyZKLQd3auVNRQC5Sv 8C6E/zeZKqlzJclB3aZPtkVUcVEH14dcR+jzgDeLyESj4iPzBNUEj3G6lJOJfxJ+Pf0j znCNc8BnEfN110Xx9GOeTj62hv6772Qtpd+UZUlOrUtoYuijwPw4sT4FERpTBSZGLuXB I+7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Mmb0AMwY7KA4BBFBr/4WxaBOD6GrsRdVk6XodB+KlyA=; b=cGRpj2cBfj2VeA0GYFCgTfq0GcbK0RhxekmPpuA9tUADGbiXxEAbLYOsZqB1+FIC81 oorKlT0GaUo4cSR+1SsXmeIQdh6zK41ffCHiPZevTwq55WCdPdBh3g9hIgx6IKyzu+1O YduDSlj1+TVSUyQguVLZ9FvWVbCdm8EcZYxDAKlMSr6Gjzveech0+b/DQSz1q7kGChAl ziVBKfpFXTGISM/23FGhqpNzK4+53jEe4UO9vngOKKGhH/AMVwEUWen57iDteB3cWvwi eRA0G9v0qUkS8VOqUksLemX3xNTRGuEHKrzmEo0fu22nGGS38Yjy5CUN0sgh4BXaWvGN dHpg== X-Gm-Message-State: AOAM532o45wYF509QF4UBWQiXxhOBxB+GIpvp5dLr3IE5vCfy9exfqzt Df9Hlza3BfZeyLaGwXGJegc= X-Received: by 2002:a17:90a:71c3:: with SMTP id m3mr8005043pjs.186.1614914391490; Thu, 04 Mar 2021 19:19:51 -0800 (PST) Received: from localhost.localdomain ([45.135.186.129]) by smtp.gmail.com with ESMTPSA id 14sm684186pfy.55.2021.03.04.19.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 19:19:50 -0800 (PST) From: Jia-Ju Bai To: leonl@leopardimaging.com, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] media: i2c: imx274: fix error return code of imx274_s_frame_interval() Date: Thu, 4 Mar 2021 19:19:42 -0800 Message-Id: <20210305031942.5648-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When __v4l2_ctrl_modify_range() fails, no error return code of imx274_s_frame_interval() is assigned. To fix this bug, ret is assigned with the return valye of __v4l2_ctrl_modify_range(), and then ret is checked. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai --- drivers/media/i2c/imx274.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c index 54642d5f2d5b..04f516cb6b07 100644 --- a/drivers/media/i2c/imx274.c +++ b/drivers/media/i2c/imx274.c @@ -1380,7 +1380,8 @@ static int imx274_s_frame_interval(struct v4l2_subdev *sd, max = fi->interval.numerator * 1000000 / fi->interval.denominator; def = max; - if (__v4l2_ctrl_modify_range(ctrl, min, max, 1, def)) { + ret = __v4l2_ctrl_modify_range(ctrl, min, max, 1, def); + if (ret) { dev_err(&imx274->client->dev, "Exposure ctrl range update failed\n"); goto unlock; -- 2.17.1