lkml.org 
[lkml]   [2023]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2023-12-21 13:37    [W:1.887 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site