mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Mirsad Todorovac <mtodorovac69@gmail.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH v2 1/1] mtd: slram: insert break after errors in parsing the map
Date: Fri, 23 Aug 2024 19:33:29 +0200	[thread overview]
Message-ID: <20240823173329.441853-1-miquel.raynal@bootlin.com> (raw)
In-Reply-To: <20240711234319.637824-1-mtodorovac69@gmail.com>

On Thu, 2024-07-11 at 23:43:20 UTC, Mirsad Todorovac wrote:
> GCC 12.3.0 compiler on linux-next next-20240709 tree found the execution
> path in which, due to lazy evaluation, devlength isn't initialised with the
> parsed string:
> 
>    289		while (map) {
>    290			devname = devstart = devlength = NULL;
>    291
>    292			if (!(devname = strsep(&map, ","))) {
>    293				E("slram: No devicename specified.\n");
>    294				break;
>    295			}
>    296			T("slram: devname = %s\n", devname);
>    297			if ((!map) || (!(devstart = strsep(&map, ",")))) {
>    298				E("slram: No devicestart specified.\n");
>    299			}
>    300			T("slram: devstart = %s\n", devstart);
>  → 301			if ((!map) || (!(devlength = strsep(&map, ",")))) {
>    302				E("slram: No devicelength / -end specified.\n");
>    303			}
>  → 304			T("slram: devlength = %s\n", devlength);
>    305			if (parse_cmdline(devname, devstart, devlength) != 0) {
>    306				return(-EINVAL);
>    307			}
> 
> Parsing should be finished after map == NULL, so a break is best inserted after
> each E("slram: ... \n") error message.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Richard Weinberger <richard@nod.at>
> Cc: Vignesh Raghavendra <vigneshr@ti.com>
> Cc: linux-mtd@lists.infradead.org
> Signed-off-by: Mirsad Todorovac <mtodorovac69@gmail.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

      reply	other threads:[~2024-08-23 17:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11 23:43 Mirsad Todorovac
2024-08-23 17:33 ` Miquel Raynal [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=20240823173329.441853-1-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mtodorovac69@gmail.com \
    --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®