Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp371977pxt; Wed, 11 Aug 2021 23:58:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBZTO3K+pvPmxhn1fRA1WIY3FfbJuu9OyW2u3U0OEHhQ3/XWCjzR8hkb1IKFfQCsG6//l7 X-Received: by 2002:a17:906:1299:: with SMTP id k25mr2229965ejb.139.1628751492747; Wed, 11 Aug 2021 23:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628751492; cv=none; d=google.com; s=arc-20160816; b=J5gEUU/0oevCci9emGK4elGBsH5qmsHmsdnKDjHSRT5isLrB5g5V7Xr/5hFIzOtMGC OWqBwenoj0kZwj9p9rq8iCVmnmVGR3ZtoMG4F/Db7Ij1wb14FPEurGFT4N4d0agGsMib BwIMl8cukrboMn899K7LhxuHK60CJm16h0xtCWSLS+c9O0qs0/12W4pA4zhdOWMSQATL cDdPPMwtx5zQ9VgylvTTyf0ZZjrDzAJ7YSNB1vH+nJ/YBM8va6d+5GV+2G2eV9UlB9Ay SDwOW0VQItDU9NuNl9oEpcOX97FE0wmszfpJC6N1lfn5lKbK47zNXBdkpc5WqdJOYNlq FYQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=j4nvU0nz0VRA3tRZXHfBBulNcjMqE9WJJt3/YgqE6V8=; b=GXIh0Y4X8ZeVrMg7y/81xhIDKpkhBcmEjchDzRiVSFMo1NEgHGTqh9Y7p6nOou6YYl ZHgbD60iwPyfO5b+fV5vv145XN5xis4CvLvE9wrx2/cN7CGPL+OICwOEWozUjukhk47S Xh3laT0N7d04ZrQCEdpJizO5drK4FDCPKNrmjaTVxqVCZbFV97z/Xc6QF1ZABWwaSxDn xdZdDqDklVMNwk+s9kGuKtbZmMv7ECTOuYiAAtjQeAwThUp5/s1bBhJoWqfYPE1otkft 6kCu1mRUj+Ug7yvuaKxzfzLqUOFekuyvZu1E72KudIPKfK0HG5HPghnNoJCFQ2nBt62l qVKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tUI1m5NU; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si1733515edb.588.2021.08.11.23.57.49; Wed, 11 Aug 2021 23:58:12 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=tUI1m5NU; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234709AbhHLGxO (ORCPT + 99 others); Thu, 12 Aug 2021 02:53:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:55876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232787AbhHLGxN (ORCPT ); Thu, 12 Aug 2021 02:53:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E634861038; Thu, 12 Aug 2021 06:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628751168; bh=fB7LS6xEGN966es5j7WEmEG8dNG0tbsP/wIbFibVgQ0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tUI1m5NUWhUxf7s8KM8cJ00b81hbvpiyM1/bUO16rB6/4e4QpNNp8XULYhQ7emEmP HKS5cYCQnIyr9LCcICB5VENOXQSQq3mGPlUXFvgfrjaLlNqTH2NHhkXYAgsdwKl6QW 9pRw+T8/hN6Ools3t+EXM2imd/1DNbDkxOmAHIN8= Date: Thu, 12 Aug 2021 08:52:45 +0200 From: Greg Kroah-Hartman To: Yizhuo Zhai Cc: Mauro Carvalho Chehab , Sakari Ailus , Juan Antonio Aldea-Armenteros , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] media: atomisp: fix the uninitialized use and rename "retvalue" Message-ID: References: <20210723003607.64179-1-yzhai003@ucr.edu> <20210812055421.44450-1-yzhai003@ucr.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210812055421.44450-1-yzhai003@ucr.edu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 11, 2021 at 10:54:17PM -0700, Yizhuo Zhai wrote: > Inside function mt9m114_detect(), variable "retvalue" could > be uninitialized if mt9m114_read_reg() returns error, however, it > is used in the later if statement, which is potentially unsafe. > > The local variable "retvalue" is renamed to "model" to avoid > confusion. > > Fixes: ad85094b293e ("Revert "media: staging: atomisp: Remove driver"") > Signed-off-by: Yizhuo Zhai > --- > drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c > index f5de81132177..77293579a134 100644 > --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c > +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c > @@ -1533,16 +1533,19 @@ static struct v4l2_ctrl_config mt9m114_controls[] = { > static int mt9m114_detect(struct mt9m114_device *dev, struct i2c_client *client) > { > struct i2c_adapter *adapter = client->adapter; > - u32 retvalue; > + u32 model; > + int ret; > > if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { > dev_err(&client->dev, "%s: i2c error", __func__); > return -ENODEV; > } > - mt9m114_read_reg(client, MISENSOR_16BIT, (u32)MT9M114_PID, &retvalue); > - dev->real_model_id = retvalue; > + ret = mt9m114_read_reg(client, MISENSOR_16BIT, MT9M114_PID, &model); > + if (ret) > + return ret; > + dev->real_model_id = model; > > - if (retvalue != MT9M114_MOD_ID) { > + if (model != MT9M114_MOD_ID) { > dev_err(&client->dev, "%s: failed: client->addr = %x\n", > __func__, client->addr); > return -ENODEV; > -- > 2.25.1 > > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what needs to be done here to properly describe this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot