Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2146888iof; Tue, 7 Jun 2022 21:18:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyN+688JZUdD/+vVTlOPQFxbwyq19BWJWvmR9ejfCqcsYzH2XjMbA3UomDj2UBD4SsoMUW/ X-Received: by 2002:a17:902:82c4:b0:167:93c0:c955 with SMTP id u4-20020a17090282c400b0016793c0c955mr6706471plz.162.1654661936043; Tue, 07 Jun 2022 21:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661936; cv=none; d=google.com; s=arc-20160816; b=Lj8SrDKuKdNS4J8vwmScYO/MPfXJeBbG8e0HcfXSb6YzMJVCvg+h25PcQSn6Psgoyh xpkUfrr1xB8jIK9zgptKqL/svwpASkttGPSZYe1j5ztDo0lRznTSkaUmS5j03TjtrwNB qu10fCiyKK/LVaoFsz0bD8Ozv8oV70n7JFFqGBADZMvFYSc8+ZXaHsjS9vRFT/1zIK2d zYrDYEA2+iBnPhCj+R7o0/Wl01XNzDJfufBX4TCj3vbUqjBEweiyf36rFqlcZDrnJ8L4 3cf6iTC0WaUAiTWWBU4FMvmvyRHMNj6l652GSyYRdaCm2o4Q+lMxYWMOkVh0SEVo1dYh P4FQ== 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=O7tWR6gthnB2vWtRuvwy4P/LujxHvIM4WnXXqe3gGpg=; b=ayfqgb4FnBwPmmWYDAEagv5O+kAzxJpj1vZgqXFurpuADfLybf1rvkoNy/Za4QDTJt BAhramoSiwqQBktElC2pU41/IIh8O2Vc4I9ok3t5p3k6hJOy8T2pu9ggz1Y0oodVoHo5 bwlLozZpLDOJVzu6BBLRdVO4yRYVPFOeeMjJ5/2anBVMIeZMuf7XJHQDsYMYPHm6arIE 0fxTkvvYczJLAXv5psUmIxgS0uQzSNEdTU076LUR/22b8KY1uA5nsu5hGI77sxbX5dvV cj9tgmTMLKktDVjPUkYHMTGaMvbMGJ2enS5yAE/fAvpoHUpH0hkmrRYSDnk+JYwodlni TL/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZSHoxsOw; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d22-20020a170902b71600b001619539fd82si24843776pls.59.2022.06.07.21.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:18:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZSHoxsOw; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5B0D4376276; Tue, 7 Jun 2022 20:50:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245451AbiFGR6A (ORCPT + 99 others); Tue, 7 Jun 2022 13:58:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347231AbiFGRhi (ORCPT ); Tue, 7 Jun 2022 13:37:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A33671929F; Tue, 7 Jun 2022 10:33:10 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B868A6146F; Tue, 7 Jun 2022 17:33:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA505C385A5; Tue, 7 Jun 2022 17:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654623189; bh=lvjgWwCWMMG4oPUt5XqFiKHL2VFjfq8Xa8zNktZpPmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZSHoxsOwvD5kDiLv/cTblZnngxsW/IVrXK5GHgpkbMX5C0Uj/Oak5Zsv770LrKCGa a5QrAFik7Wl42J29nnZNa0HQb84tfuC0ytpZxq/1IAa8sGxMpR67VtCYmiKMCUjZXg kO4CSMRo4F+EHJEyUuYXH+RcVfQ6z10Uy8RDspYk= 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.10 326/452] i2c: at91: Initialize dma_buf in at91_twi_xfer() Date: Tue, 7 Jun 2022 19:03:03 +0200 Message-Id: <20220607164918.275566049@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 974225faaf96..7960fa4b8c5b 100644 --- a/drivers/i2c/busses/i2c-at91-master.c +++ b/drivers/i2c/busses/i2c-at91-master.c @@ -657,7 +657,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