Re: [PATCH] drivers/staging/media/atomisp: Initialize curr_rules in atomisp_freq_scaling

From: Dan Carpenter

Date: Mon Oct 26 2026 - 12:45:23 EST


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@xxxxxxxxx>

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
>