From patchwork Fri Sep 27 13:34:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qianqiang Liu X-Patchwork-Id: 831365 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCBB9282FA; Fri, 27 Sep 2024 13:35:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727444115; cv=none; b=B19SjdZ3f9wtbQ/2dxN8T0maIYZloXDIe/7SPSn+x4Czi9yVRCuWpOJXItheOaxlRomkQsQ/prxOMzGMbV3vaBBSiLdWhzZG5GJVEelkI262d07iNh/UMe+w6RxjEKX+IwHmhXJgQ5onEmkYvEiW1QGHBU2Ke8yKJoe0+DS3UsU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727444115; c=relaxed/simple; bh=M98aC3Vt47AfY7jwZd9jT+21wUxJ441VFSQAno7rbpE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OvoPKjJJrKQ/vCAXMJ2lqEGfxMt2qFYleLlWPh6cLfii62hKtN0SqIouY1ALQDzPGmI+JGspBacAXMbjGgDRdW+LW1VHNaL2BbrUehCOPbRoDPiE6voUXF8hg3J1A6R4XJMvoHi1WZiHhOMgnWx9WylKyGjK0Q7mhjpMkH4Ra1s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=hRldsn+y; arc=none smtp.client-ip=117.135.210.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="hRldsn+y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version: Content-Type; bh=m80VoOaqUmL/nePtQcoKeORM7DgYXRyb9y7o7CpzM78=; b=hRldsn+yFsMxB+YuvCMzhW/0Krx4FLrpaMtcZwzvXRsrtWfbG95KCRbEltqRPa 7oWFAp/kEZrWawa9Mkv0QiO0r0BCe8I+CvUBkKaYNSuS+RZKoN0cgYhy4aqR5p17 M32ovYgLDnjRr4Q6A06iIJe9RwXGQAKPzl9IArp7wOQGY= Received: from localhost (unknown [120.26.85.94]) by gzga-smtp-mta-g2-1 (Coremail) with SMTP id _____wD3X_l0tPZmMxRHAw--.18019S2; Fri, 27 Sep 2024 21:34:45 +0800 (CST) Date: Fri, 27 Sep 2024 21:34:44 +0800 From: Qianqiang Liu To: Dan Carpenter Cc: andi.shyti@kernel.org, shyam-sundar.s-k@amd.com, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] i2c: amd-asf: Fix uninitialized variables issue in amd_asf_process_target Message-ID: References: <20240926151348.71206-1-qianqiang.liu@163.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CM-TRANSID: _____wD3X_l0tPZmMxRHAw--.18019S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7XF1ktw1fAw1kurW7WF48WFg_yoWfWFcEk3 Z5Wa12gr4vkrn5XF1YqFs8XrW0gr1qgF1xu3WFkFs0krya9w13WFyqv3s3JrsrWrZrKF1a 9w1UWF47CFsxCjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUe_pnPUUUUU== X-CM-SenderInfo: xtld01pldqwhxolxqiywtou0bp/1tbiLwJnamb2pbX66gAAsw The len variable is not initialized, which may cause the for loop to behave unexpectedly. Fixes: 20c3cc299218 ("i2c: amd-asf: Add routine to handle the ASF slave process") Signed-off-by: Qianqiang Liu Acked-by: Shyam Sundar S K --- drivers/i2c/busses/i2c-amd-asf-plat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-amd-asf-plat.c b/drivers/i2c/busses/i2c-amd-asf-plat.c index 47e0c90341aed..ba47df5370c72 100644 --- a/drivers/i2c/busses/i2c-amd-asf-plat.c +++ b/drivers/i2c/busses/i2c-amd-asf-plat.c @@ -61,7 +61,7 @@ static void amd_asf_process_target(struct work_struct *work) unsigned short piix4_smba = dev->port_addr->start; u8 data[ASF_BLOCK_MAX_BYTES]; u8 bank, reg, cmd; - u8 len, idx, val; + u8 len = 0, idx, val; /* Read target status register */ reg = inb_p(ASFSLVSTA);