Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2199110iof; Tue, 7 Jun 2022 23:00:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrrRvqBQ3fv+p113WxS0I+yl2MmbNz+PrD6tVQ6qfqDBmKI4Uz/L0aBEVAApqxtS39tXJ2 X-Received: by 2002:a63:7f08:0:b0:3fd:6d25:8a5d with SMTP id a8-20020a637f08000000b003fd6d258a5dmr16906010pgd.240.1654668001694; Tue, 07 Jun 2022 23:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668001; cv=none; d=google.com; s=arc-20160816; b=y20lA/RZ/MEuO+64donQPNnQbDWws8/eT6onNc47myo6NVErvangeQtAvQaEMTCIP9 7JbVLytzbMEuMaTOqbOxrBiQ/GmJ4AMifnuL9/lGA1UcZQlXIsZtP0lMOUhjPCg6mKhD ChYPzpTRZ98Vwne3T/TlfU0iiaN+Njn9LYziX7Wugl74b4QnH/Sag3mUOUDEIR61KOUj di5OQlmSwV4pZsDe11MDVRUkTMJ0VKkNDlxiLWTTa/foq9y2I8qfrUu+vN3wujd46p9P j5tUE9XK/99C6fbXvLc5axa2RRpOLTrSIHXqRemr3Q1H4CO/2XWPl7RF8Y2IOc3TdH1B Ro6w== 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=qQIR9FWz8GFH9Kz+Q4psmOAFMB+/BgTPHtnDyv1Ix/c=; b=c2vg6rnIigB3DzjALskJ/xtJFUCbzSOocTxh3pPTFMJfWA1PuoNKa74yCuLJIdv8AJ DoDUqYiQANHbcyVuI1CI+wgY2xPP29l+/aGyLGEKdYhrxuqMHFe1nVM7apTr2YJn2qJt BrArpi1sx9C8dalYNflSIbTT536TIaHmc83RnZd2Oe63e/m1RuOPlaKOqb+6zm31nYxm 8Fbj8l+CGx05+DhvYSZtkwHOtxSVdw+/3qJzAo+AsUIdLEDd607YGb7u624zRIn/KYzH 2K0/Fa+tCZ6JnfSqSs6FuXW/AaGutKpC0zjfX1x7IOPKpm1sITbrwcqhoXJSFaFrXPTP ByeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1tktq4tD; 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 j3-20020a170903028300b001674d42aef2si25113017plr.411.2022.06.07.23.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:00:01 -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=1tktq4tD; 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 53C70136C0B; Tue, 7 Jun 2022 22:25:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442145AbiFHBGo (ORCPT + 99 others); Tue, 7 Jun 2022 21:06:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383687AbiFGWGJ (ORCPT ); Tue, 7 Jun 2022 18:06:09 -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 3D14C344EF; Tue, 7 Jun 2022 12:16:52 -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 CD3006192C; Tue, 7 Jun 2022 19:16:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9200C385A2; Tue, 7 Jun 2022 19:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629411; bh=M6FS/lCEmvw7N1uBROVZHZ6Aqu6ichPOYpC36essZ+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1tktq4tDZsZ92JEAIywcesrxYNbw4/iFyJJrC70L+roPcuic6SIa6gEPIBeWCdS0P hTwNBy/wZaQeBrVBORU5CgtbFIwRijVLacQb8acwmmVFd7zH4B7lIf64StY8nrxTxs lZHseJoOfTJRxOQxN5XcAVGjfy0jyUxZrWYzSXKk= 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.18 674/879] i2c: at91: Initialize dma_buf in at91_twi_xfer() Date: Tue, 7 Jun 2022 19:03:12 +0200 Message-Id: <20220607165022.413390044@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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 5eca3b3bb609..c0c35785a0dc 100644 --- a/drivers/i2c/busses/i2c-at91-master.c +++ b/drivers/i2c/busses/i2c-at91-master.c @@ -656,7 +656,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