From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Koichiro Den <koichiro.den@canonical.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] gpio: aggregator: fix "_sysfs" prefix check in gpio_aggregator_make_group()
Date: Wed, 21 Jan 2026 15:04:49 +0100 [thread overview]
Message-ID: <aXDdARDpyzF_jC4l@black.igk.intel.com> (raw)
In-Reply-To: <30210ed77b40b4b6629de659cb56b9ec7832c447.1744452787.git.dan.carpenter@linaro.org>
On Sat, Apr 12, 2025 at 01:15:00PM +0300, Dan Carpenter wrote:
> This code is intended to reject strings that start with "_sysfs" but the
> strcmp() limit is wrong so checks the whole string instead of the prefix.
...
> if (strncmp(name, AGGREGATOR_LEGACY_PREFIX,
> - sizeof(AGGREGATOR_LEGACY_PREFIX)) == 0)
> + sizeof(AGGREGATOR_LEGACY_PREFIX) - 1) == 0)
> return ERR_PTR(-EINVAL);
Wouldn't be better to use strstarts() / str_has_prefix()?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-01-21 14:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-12 10:14 [PATCH 0/5] gpio: aggregator: Fix Smatch warnings Dan Carpenter
2025-04-12 10:15 ` [PATCH 1/5] gpio: aggregator: fix "_sysfs" prefix check in gpio_aggregator_make_group() Dan Carpenter
2025-04-14 7:52 ` Geert Uytterhoeven
2026-01-21 14:04 ` Andy Shevchenko [this message]
2025-04-12 10:15 ` [PATCH 2/5] gpio: aggregator: Fix gpio_aggregator_line_alloc() checking Dan Carpenter
2025-04-12 10:15 ` [PATCH 3/5] gpio: aggregator: Return an error if there are no GPIOs in gpio_aggregator_parse() Dan Carpenter
2025-04-12 10:15 ` [PATCH 4/5] gpio: aggregator: Fix error code in gpio_aggregator_activate() Dan Carpenter
2025-04-12 10:15 ` [PATCH 5/5] gpio: aggregator: Fix leak in gpio_aggregator_parse() Dan Carpenter
2025-04-12 14:45 ` [PATCH 0/5] gpio: aggregator: Fix Smatch warnings Koichiro Den
2025-04-12 16:43 ` Dan Carpenter
2025-04-14 20:26 ` Bartosz Golaszewski
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=aXDdARDpyzF_jC4l@black.igk.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=brgl@bgdev.pl \
--cc=dan.carpenter@linaro.org \
--cc=geert+renesas@glider.be \
--cc=koichiro.den@canonical.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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