mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tudor Ambarus <tudor.ambarus@linaro.org>
To: miquel.raynal@bootlin.com
Cc: pratyush@kernel.org, michael@walle.cc, richard@nod.at,
	vigneshr@ti.com, Takahiro.Kuwano@infineon.com,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	geert@linux-m68k.org
Subject: Re: [PATCH v2] mtd: spi-nor: spansion: make sure local struct does not contain garbage
Date: Wed, 17 May 2023 08:17:46 +0100	[thread overview]
Message-ID: <41d0bb3f-559d-ac70-9525-dd98b820a85c@linaro.org> (raw)
In-Reply-To: <20230509193900.948753-1-tudor.ambarus@linaro.org>

Miquel, please consider this fix for -rc3.

cheers,
ta

On 5/9/23 20:39, Tudor Ambarus wrote:
> Following errors were seen with um-x86_64-gcc12/um-allyesconfig:
> + /kisskb/src/drivers/mtd/spi-nor/spansion.c: error: 'op' is used uninitialized [-Werror=uninitialized]:  => 495:27, 364:27
> 
> Initialise local struct spi_mem_op with all zeros at declaration in
> order to avoid using garbage data for fields that are not explicitly
> set afterwards.
> 
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Fixes: c87c9b11c53ce ("mtd: spi-nor: spansion: Determine current address mode")
> Fixes: 6afcc84080c41 ("mtd: spi-nor: spansion: Add support for Infineon S25FS256T")
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> v2:
> - init both local vars with all zeros at declaration
> - squash patches as the blamed commits were just introduced in this
>   merge window.
> 
>  drivers/mtd/spi-nor/spansion.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
> index 15f9a80c10b9..36876aa849ed 100644
> --- a/drivers/mtd/spi-nor/spansion.c
> +++ b/drivers/mtd/spi-nor/spansion.c
> @@ -361,7 +361,7 @@ static int cypress_nor_determine_addr_mode_by_sr1(struct spi_nor *nor,
>   */
>  static int cypress_nor_set_addr_mode_nbytes(struct spi_nor *nor)
>  {
> -	struct spi_mem_op op;
> +	struct spi_mem_op op = {};
>  	u8 addr_mode;
>  	int ret;
>  
> @@ -492,7 +492,7 @@ s25fs256t_post_bfpt_fixup(struct spi_nor *nor,
>  			  const struct sfdp_parameter_header *bfpt_header,
>  			  const struct sfdp_bfpt *bfpt)
>  {
> -	struct spi_mem_op op;
> +	struct spi_mem_op op = {};
>  	int ret;
>  
>  	ret = cypress_nor_set_addr_mode_nbytes(nor);

  reply	other threads:[~2023-05-17  7:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-07 21:18 Linux 6.4-rc1 Linus Torvalds
2023-05-08 11:57 ` Build regressions/improvements in v6.4-rc1 Geert Uytterhoeven
2023-05-08 12:14   ` Geert Uytterhoeven
2023-05-08 15:19     ` Pratyush Yadav
2023-05-08 15:32       ` Geert Uytterhoeven
2023-05-08 15:46       ` Raghavendra, Vignesh
2023-05-09 19:25     ` [PATCH 1/2] mtd: spi-nor: spansion: make sure local struct does not contain garbage Tudor Ambarus
2023-05-09 19:25       ` [PATCH 2/2] " Tudor Ambarus
2023-05-09 19:30         ` Tudor Ambarus
2023-05-09 19:39     ` [PATCH v2] " Tudor Ambarus
2023-05-17  7:17       ` Tudor Ambarus [this message]
2023-05-22 15:58       ` Miquel Raynal
2023-05-08 20:34 ` Linux 6.4-rc1 Guenter Roeck
2023-05-10  4:31 ` linux-next stats (Was: Linux 6.4-rc1) Stephen Rothwell

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=41d0bb3f-559d-ac70-9525-dd98b820a85c@linaro.org \
    --to=tudor.ambarus@linaro.org \
    --cc=Takahiro.Kuwano@infineon.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®