From: Adam Goldman <adamg@pobox.com>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/8] firewire: core: detect model name for legacy layout of configuration ROM
Date: Thu, 21 Dec 2023 04:50:08 -0800 [thread overview]
Message-ID: <ZYQ0gNwDsocA9QS7@iguana.lan> (raw)
In-Reply-To: <20231220041806.39816-8-o-takashi@sakamocchi.jp>
Hi,
> - ret = fw_csr_string(dir, attr->key, buf, bufsize);
> + for (i = 0; i < ARRAY_SIZE(directories) && !!directories[i]; ++i) {
> + int result = fw_csr_string(directories[i], attr->key, buf, bufsize);
> + // Detected.
> + if (result >= 0)
> + ret = result;
> + }
>
> if (ret >= 0) {
ret is an automatic variable with no initializer. Unless you initialize
it (to -ENOENT), this is UB.
-- Adam
next prev parent reply other threads:[~2023-12-21 12:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 4:17 [PATCH 0/8] firewire: core: support legacy layout of configuration ROM for AV/C device Takashi Sakamoto
2023-12-20 4:17 ` [PATCH 1/8] firewire: core: adds constant qualifier for local helper functions Takashi Sakamoto
2023-12-20 4:18 ` [PATCH 2/8] firewire: core: replace magic number with macro Takashi Sakamoto
2023-12-20 4:18 ` [PATCH 3/8] firewire: test: add KUnit test for device attributes Takashi Sakamoto
2023-12-20 4:18 ` [PATCH 4/8] firewire: test: add test of device attributes for simple AV/C device Takashi Sakamoto
2023-12-20 4:18 ` [PATCH 5/8] firewire: test: add test of device attributes for legacy " Takashi Sakamoto
2023-12-20 4:18 ` [PATCH 6/8] firewire: core: detect numeric model identifier for legacy layout of configuration ROM Takashi Sakamoto
2023-12-20 4:18 ` [PATCH 7/8] firewire: core: detect model name " Takashi Sakamoto
2023-12-21 12:50 ` Adam Goldman [this message]
2023-12-21 13:12 ` Takashi Sakamoto
2023-12-20 4:18 ` [PATCH 8/8] firewire: core: change modalias of unit device with backward incompatibility Takashi Sakamoto
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=ZYQ0gNwDsocA9QS7@iguana.lan \
--to=adamg@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=o-takashi@sakamocchi.jp \
/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