Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1600948pxu; Tue, 24 Nov 2020 04:38:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3bAPehlMDKpxAtTtiXD8GLTChyVfZWk25FlcPZlvQPxgFJiH67x+iceMrSTQVlDD0zT// X-Received: by 2002:a50:cfcf:: with SMTP id i15mr3690703edk.351.1606221491610; Tue, 24 Nov 2020 04:38:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606221491; cv=none; d=google.com; s=arc-20160816; b=AQGbvOZnqLYFk+Gk1lxEQ/UYdo/Gd9xdpyNi2tIl5n/+k7aUqtCeGYvObElCAuApiJ K6fZJtd4dlm0jH5alxubLEiIzMOlys6owVorOwh7dUCGZj5j3Y+fIt2lF+1CEHUY9+wO OcTemL4eLFQkz0ZsidfzPrJTacPAswREqhxfETmLl0Z3RABFg+XUyxCdIgMnO7cDCLvy Xg3NMc+mu0p1zrK4HB8qgFZ7DRl1A+eILaY4dg6IuyaZhh6My7F+rkuxnCr3tRcGMI9T HvskQRoMOaZQkZy8F6WQMfbth2WvpDwD9OsJs3E8mOPW6xQ4PyLkhcviHpsbzAJXCJzF 8lpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=cWIsfkEpAEG9V75yVB7Vbi23yq6HRhA/qKbNJ6gQqlU=; b=TKlRR68QZkHtMLLqqNj3eISml24Y88uxD4Ck3O1LyEHBRTF/UwhQzeYrDhfAOJj6Q3 rcW6Ed0zXfUEFMnMRMwo47HgeDPzmlYnnEpG1qIAwVGzoLgGLFsXc6rs/gYHGljSkn4u 5L6bJOpQ3E8zbRa5fG8U/3T+o2ozupr+IRY6A/VmEuO1xSwKcsY9AqW6k8aCwhwdt3wX FEdixQwlfvCBdMW7B19wb+3HdWPJrGmWa9qdSNnuRK+Mt2Ssx5oF0lcx6u1INjSb6VSS 0Ek+5CPAf4RWwNGpRYPBC1xbK3dOXNSdeOKJA4EX/IT8eSZItwCmo+KKJ0N4mCNR4b4W awsA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t3si8149053edt.474.2020.11.24.04.37.48; Tue, 24 Nov 2020 04:38:11 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387499AbgKXMfJ (ORCPT + 99 others); Tue, 24 Nov 2020 07:35:09 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:52429 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729172AbgKXMfI (ORCPT ); Tue, 24 Nov 2020 07:35:08 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1khXXE-0004vU-LI; Tue, 24 Nov 2020 12:35:04 +0000 From: Colin King To: Boris Brezillon , Nicolas Pitre , linux-i3c@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] i3c/master: Fix uninitialized variable next_addr Date: Tue, 24 Nov 2020 12:35:04 +0000 Message-Id: <20201124123504.396249-1-colin.king@canonical.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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