Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1741439pxu; Tue, 24 Nov 2020 07:53:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvU5zaPzbSRl/aLsZsFOVYAM5H7vkvcigyo9HehmmfqUHKvfAVaMiNAQnJMhsTV9JgkDC1 X-Received: by 2002:a05:6402:1d85:: with SMTP id dk5mr4576243edb.283.1606233219778; Tue, 24 Nov 2020 07:53:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606233219; cv=none; d=google.com; s=arc-20160816; b=Ni/2SURaz8MAy8qapJ+6V334dQIulMa7ACgmZf/DJC0CTWj1mLPNY1iKVdrw4jTT+j 0W9lIrZnvyavo6jl3CRoHc2qfH9xPEHgxU1jLobByqdAGR2VDP2C7X5ra+5jZZ6XFH7S WJN4kp+DoodT6MksLA4NRJ8tiwKsaPZpI8CWy8PrREKhh0ANs+nYLHmZ+B6RU+oy1ZVU yOJsA7SFqDGeIBKmrq2ZNMbUA3Gpw7TSIAri1IFljNe19Z4rMYo3SXoFciKl2u8qQ529 QB5feg4xRqUtDjDmZIC9qxykYLg3RLWS7r8p+SEVnU6cJrZDgA45OprwXIptrw/P7EEc CJHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=ubJInrGSsPLGKGouG7fpjnMRMu6mjU1dee+kkLRQJso=; b=ksCEztLdbq1bU4b/6MAEhlqmVdufRPBdpCmc0q2a7DAbq2BlBlW+HSioKRnMECyJrG alIO/45wSx4Cl9mkcWMgiXiRxGxLDIWl0VHVdnfMZZSXv0xqaiJoRhawfzSh9NdiF7bx Uk6RbVIoa3KX/W4BQqLhjrcXGM7loKgSFV/T+JgaJsPNlpIy+MSL1zRL7QVBrahfC4Mc Y7tT4ZxhLNu2FvuppxcVTFC5iWdL/pO01C3cbU/wRAcyGU3AuZKkNnvIgFXqV/sD92pn qasUfLSC8LXXvKNLbPXGtqrr2QXOUwkz/vv8FsWMEZow5ncxWJYU5JbN6fekIHGnoU8g 8EyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=hHQILDw0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j17si8388164ejv.267.2020.11.24.07.53.16; Tue, 24 Nov 2020 07:53:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=hHQILDw0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389868AbgKXPsD (ORCPT + 99 others); Tue, 24 Nov 2020 10:48:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389629AbgKXPsD (ORCPT ); Tue, 24 Nov 2020 10:48:03 -0500 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EC06C0617A6 for ; Tue, 24 Nov 2020 07:48:03 -0800 (PST) Received: by mail-qv1-xf42.google.com with SMTP id e14so10815939qve.3 for ; Tue, 24 Nov 2020 07:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=ubJInrGSsPLGKGouG7fpjnMRMu6mjU1dee+kkLRQJso=; b=hHQILDw03u/sl9BOCAlhrVjo9pT1JNk1zqKicW8pDpjpdemn2tv0bQrmpqWWp9TJPp 9WRL3NIb6Oyo/7pQmptCxsdnzIgS4TZC+smRhtxd34Vj6OvTCQWwuPS7kFj2+UAO0Xgy 4/0c9vuOfTsKe5SFMTjEs+G8oz0P5j3G7CxmCLKbzuAE8hevvUEVPk5huxPVSZ4cBm7f JVIG/DOVhd6fUdJA+yPBVPBoMjucv8i/mhsuJdwb+V9mEc8pocbx72lGwXRhFQ7FxBYO c4k508M0ay+aTrTr3wbwrpo4b+kQu5nNDoW/aFjAK/pypvbh7Cby3FBjs7cmT3ChR44g IlVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=ubJInrGSsPLGKGouG7fpjnMRMu6mjU1dee+kkLRQJso=; b=FmWxJt0BAUYd7kZQ2Yld70CLSyztZ5WJypIR0ifw2ZJa5SuNHJz5EPE4T96h5wLgKe CFYXRsuCw07pm0XCa7gv0G7IezmcryGqWoyqUv2hH7u4iqzhfh/Mqq3AJYwB3vbrwUfn U0FQRXd0Prt53JtTLbYFlJx7MKrwQAU/LiDFf1JYflLsc+JXeJilS42/bn5gYjIN3wqJ Wl7H97+ARI/dzUpM0HWziCVwkC7FwRA+c80iJvRikS34e7riG4ike9nVt+gUVmXGBnNA Pb29yohwZ75eKeKS3nZ8SLdb/OJZBQ8Vyrzz2cheyjAhHARHnsY77CrpisQGPNUTodQG DjAA== X-Gm-Message-State: AOAM531mK201EEl6TJu+qi1HVh27YggoYbr4ct7HpACAnFCQjimRBWbz A89NXJUTeCef9C61r9XB6VpCyQ== X-Received: by 2002:ad4:524b:: with SMTP id s11mr5485759qvq.3.1606232882237; Tue, 24 Nov 2020 07:48:02 -0800 (PST) Received: from xanadu.home (modemcable076.50-203-24.mc.videotron.ca. [24.203.50.76]) by smtp.gmail.com with ESMTPSA id i9sm12931180qtp.72.2020.11.24.07.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 07:48:01 -0800 (PST) Date: Tue, 24 Nov 2020 10:48:00 -0500 (EST) From: Nicolas Pitre To: Colin King cc: Boris Brezillon , linux-i3c@lists.infradead.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] i3c/master: Fix uninitialized variable next_addr In-Reply-To: <20201124123504.396249-1-colin.king@canonical.com> Message-ID: References: <20201124123504.396249-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Nov 2020, Colin King wrote: > From: Colin Ian King > > The variable next_addr is not initialized and is being used in a call > to i3c_master_get_free_addr as a starting point to find the next address. > Fix this by initializing next_addr to 0 to avoid an uninitialized garbage > starting address from being used. > > Addresses-Coverity: ("Uninitialized scalar variable") > Fixes: 9ad9a52cce28 ("i3c/master: introduce the mipi-i3c-hci driver") > Signed-off-by: Colin Ian King Acked-by: Nicolas Pitre > --- > drivers/i3c/master/mipi-i3c-hci/cmd_v1.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/i3c/master/mipi-i3c-hci/cmd_v1.c b/drivers/i3c/master/mipi-i3c-hci/cmd_v1.c > index 6dd234a82892..d97c3175e0e2 100644 > --- a/drivers/i3c/master/mipi-i3c-hci/cmd_v1.c > +++ b/drivers/i3c/master/mipi-i3c-hci/cmd_v1.c > @@ -293,7 +293,7 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci) > { > struct hci_xfer *xfer; > int ret, dat_idx = -1; > - u8 next_addr; > + u8 next_addr = 0; > u64 pid; > unsigned int dcr, bcr; > DECLARE_COMPLETION_ONSTACK(done); > -- > 2.29.2 > >