Re: [RFC PATCH 7/8] firewire: core: detect model name for legacy layout of configuration ROM

From: Adam Goldman
Date: Mon Dec 18 2023 - 05:12:30 EST


Hi,

On Sun, Dec 17, 2023 at 07:30:10PM +0900, Takashi Sakamoto wrote:
> - ret = fw_csr_string(dir, attr->key, buf, bufsize);
> + for (i = 0; i < ARRAY_SIZE(directories) && directories[i]; ++i)
> + ret = fw_csr_string(directories[i], attr->key, buf, bufsize);

I believe this is incorrect. If the attribute is in the first directory
searched, the loop will continue. The second loop iteration will set ret
to -ENOENT because the attribute isn't in the second directory. Then
show_text_leaf will return -ENOENT even though the attribute existed.

-- Adam