From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 482DF1DDE3 for ; Thu, 21 Dec 2023 12:36:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=pobox.com Received: from iguana.lan (99-122-168-208.lightspeed.irvnca.sbcglobal.net [99.122.168.208]) by relay05.pair.com (Postfix) with ESMTP id B64761A163A; Thu, 21 Dec 2023 07:36:45 -0500 (EST) Date: Thu, 21 Dec 2023 04:50:08 -0800 From: Adam Goldman To: Takashi Sakamoto 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 Message-ID: References: <20231220041806.39816-1-o-takashi@sakamocchi.jp> <20231220041806.39816-8-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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