Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp449066iog; Mon, 13 Jun 2022 06:11:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTUKVXI9LiEbIOPWzUhnC0NQk7+5iojOh+MsomhoZCMhgbc74X6IbzFbc4UbxX9h6HVfMW X-Received: by 2002:a17:902:e8d6:b0:161:ea52:cd52 with SMTP id v22-20020a170902e8d600b00161ea52cd52mr57728166plg.71.1655125898259; Mon, 13 Jun 2022 06:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125898; cv=none; d=google.com; s=arc-20160816; b=Vd9QjaF9FtruJ2HFHlChafY9CPxttfjvujyKror7p2pw5QaGIwyoqae5xVuhAZFQ7i eILzJ9wxJd90xLmsD0HB2FjNt9BIScEzq2I4vtiVlU30wAgVd6xQXG99fXJL/z11y8RY xn73egv8oiRBEk908QP9fZkIPLKS9HjmF30Sf6huGkrvtd55tLiK97xLjR8DAAf3n1PV Nl1+ck/naChA/Z9LEP+FgKkUThw/W1Z0PHiKknJ6up7S0HVTYothhaf/AW6oz6a4r5RV LSWQJmC3OkLJ3DDHyffN9hyyikavhm5l/Iqom3H8DrztfNyocabAFxC8XjvA0/+YkTSI RKqQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WQfZnEsQQ7eU0bWjZAVXF5lvw1pAwtsW6aqDM2FKjP8=; b=hEW1OMdXc/qis9PUh33sGhGXgPE9RG+gHCuTesEoOWzT/Qwkq36tIP8+evrSI37YP1 8ACylYtcfWek4PSqtTohLNLZqceNmuzRe41Rjd7TxVkqlaGQuBoJl6GHw7kFhe3B3DOy jkIzfmt5O94bJHx267DkDBjfEuglx4oXu9eZw59mZRDJ9ZsU3ncORC9fbOGFr7bOQp2n CNrNZPDrPr75LystygTCJcTcR5kxYRvnGuQytbcPDlYygNNVuwEVg0CIRA99zddlT18h BMQK2LVlYVXfGw7EM3RUOOcx5tpDvoeosXjZ1YwTPhLLZLK0LcnETFIrChywQp6eD60C UD4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="D/ya9+4x"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb6-20020a17090b35c600b001e08418faecsi8738345pjb.23.2022.06.13.06.11.20; Mon, 13 Jun 2022 06:11:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="D/ya9+4x"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353078AbiFMLZt (ORCPT + 99 others); Mon, 13 Jun 2022 07:25:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353153AbiFMLTM (ORCPT ); Mon, 13 Jun 2022 07:19:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 256C23A5C3; Mon, 13 Jun 2022 03:41:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4D920B80EAA; Mon, 13 Jun 2022 10:41:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF97BC34114; Mon, 13 Jun 2022 10:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116860; bh=jGeZxlUIN3xLJC961hH/xnbk8vx7G1hFEgsXY9u7FGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D/ya9+4xOnV7SYw7w47rSnfAcPA8V91KxuxVWYZWZ6AJWSTXOclX6acxMNHmMyIib OxiB9rQ2+aRDJ0I6YWpjqst9e5NAt2DZKEKc9gzBBoSsajpV6cxgk4vHQi4dbaZ7Dt dKIbYJc33yr4A04TIXmtFghUIA3Q+efhPnjzyQDk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Michael Walle , Wolfram Sang , Sasha Levin Subject: [PATCH 5.4 199/411] i2c: at91: Initialize dma_buf in at91_twi_xfer() Date: Mon, 13 Jun 2022 12:07:52 +0200 Message-Id: <20220613094934.628406459@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 6977262c2eee111645668fe9e235ef2f5694abf7 ] Clang warns: drivers/i2c/busses/i2c-at91-master.c:707:6: warning: variable 'dma_buf' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (dev->use_dma) { ^~~~~~~~~~~~ drivers/i2c/busses/i2c-at91-master.c:717:27: note: uninitialized use occurs here i2c_put_dma_safe_msg_buf(dma_buf, m_start, !ret); ^~~~~~~ Initialize dma_buf to NULL, as i2c_put_dma_safe_msg_buf() is a no-op when the first argument is NULL, which will work for the !dev->use_dma case. Fixes: 03fbb903c8bf ("i2c: at91: use dma safe buffers") Link: https://github.com/ClangBuiltLinux/linux/issues/1629 Signed-off-by: Nathan Chancellor Reviewed-by: Michael Walle Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-at91-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c index 44502024cc10..f74d5ad2f1fa 100644 --- a/drivers/i2c/busses/i2c-at91-master.c +++ b/drivers/i2c/busses/i2c-at91-master.c @@ -609,7 +609,7 @@ static int at91_twi_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num) unsigned int_addr_flag = 0; struct i2c_msg *m_start = msg; bool is_read; - u8 *dma_buf; + u8 *dma_buf = NULL; dev_dbg(&adap->dev, "at91_xfer: processing %d messages:\n", num); -- 2.35.1