[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZYQ0gNwDsocA9QS7@iguana.lan>
Date: Thu, 21 Dec 2023 04:50:08 -0800
From: Adam Goldman <adamg@...ox.com>
To: Takashi Sakamoto <o-takashi@...amocchi.jp>
Cc: linux1394-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/8] firewire: core: detect model name for legacy layout
of configuration ROM
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
Powered by blists - more mailing lists