All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Abdullah Mohammd Sifat <sifat.yt.2.0c@gmail.com>
Cc: hansg@kernel.org, mchehab@kernel.org, gregkh@linuxfoundation.org,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/staging/media/atomisp: Initialize curr_rules in atomisp_freq_scaling
Date: Mon, 26 Oct 2026 19:42:07 +0300	[thread overview]
Message-ID: <at-C33IuUEms74EL@stanley.mountain> (raw)
In-Reply-To: <20261026161058.25031-1-sifat.yt.2.0c@gmail.com>

On Mon, Oct 26, 2026 at 04:10:58PM +0000, Abdullah Mohammd Sifat wrote:
> The local structure 'curr_rules' is declared on the stack but is
> not initialized. Initialize it to zero using empty brackets '{}'
> to prevent potential information leakage of stack garbage values.
> 
> Signed-off-by: Abdullah Mohammd Sifat <sifat.yt.2.0c@gmail.com>

The commit message says it fixes a bug but there is no fixes tag.

> ---
>  drivers/staging/media/atomisp/pci/atomisp_cmd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
> index e66a7d1c7a0e..d4de2bd9a0a5 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
> @@ -170,7 +170,6 @@ static int write_target_freq_to_hw(struct atomisp_device *isp,
>  		dev_err(isp->dev, "DFS target freq is rejected by HW.\n");
>  		return -EINVAL;
>  	}
> -

Deleting this blank line is unrelated and wrong.

>  	return 0;
>  }
>  
> @@ -180,7 +179,8 @@ int atomisp_freq_scaling(struct atomisp_device *isp,
>  {
>  	const struct atomisp_dfs_config *dfs;
>  	unsigned int new_freq;
> -	struct atomisp_freq_scaling_rule curr_rules;
> +	struct atomisp_freq_scaling_rule curr_rules = {};

I reviewed this and the original code is fine.

.isp_freq is never initialized but also never used so that might be
the confusion?

regards,
dan carpenter

> +
>  	int i, ret;
>  	unsigned short fps = 0;
>  
> -- 
> 2.53.0
> 

      parent reply	other threads:[~2026-10-26 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 16:10 [PATCH] drivers/staging/media/atomisp: Initialize curr_rules in atomisp_freq_scaling Abdullah Mohammd Sifat
2026-10-26 16:33 ` Greg KH
2026-10-26 16:42 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=at-C33IuUEms74EL@stanley.mountain \
    --to=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=sifat.yt.2.0c@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.