From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1027DC4338F for ; Mon, 2 Aug 2021 13:48:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF02E60527 for ; Mon, 2 Aug 2021 13:48:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234527AbhHBNsr (ORCPT ); Mon, 2 Aug 2021 09:48:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:56848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234262AbhHBNrC (ORCPT ); Mon, 2 Aug 2021 09:47:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C738560527; Mon, 2 Aug 2021 13:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627912013; bh=Gudp8J5W1gnJEbJwes9Zn2naYxoaEFxWmhDv7mTC0Sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jn2otSIUwbT7JHpbXRT63fOnUAWHWXoyVNYo8MsADJ/ys2L0bPoLrDZEhcHsPdjUM xVnwVkLG9XAToSApqRNhKIHo96RU9nnO+Zfzj2G9qg2HjPe6ScTb0OD94b0Y8zK3cQ 7r3pRYElN7EDKkSEpQwZmKs0QcikWW4WCBXllIbQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrey Ryabinin , Joerg Roedel , Will Deacon , kernel test robot , Nathan Chancellor , Joerg Roedel Subject: [PATCH 4.9 01/32] iommu/amd: Fix backport of 140456f994195b568ecd7fc2287a34eadffef3ca Date: Mon, 2 Aug 2021 15:44:21 +0200 Message-Id: <20210802134332.978902579@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802134332.931915241@linuxfoundation.org> References: <20210802134332.931915241@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore 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: Nathan Chancellor Clang warns: drivers/iommu/amd_iommu.c:1335:6: warning: variable 'flags' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!pte) ^~~~ drivers/iommu/amd_iommu.c:1352:40: note: uninitialized use occurs here spin_unlock_irqrestore(&domain->lock, flags); ^~~~~ drivers/iommu/amd_iommu.c:1335:2: note: remove the 'if' if its condition is always false if (!pte) ^~~~~~~~~ drivers/iommu/amd_iommu.c:1331:21: note: initialize the variable 'flags' to silence this warning unsigned long flags; ^ = 0 1 warning generated. The backport of commit 140456f99419 ("iommu/amd: Fix sleeping in atomic in increase_address_space()") to 4.9 as commit 1d648460d7c5 ("iommu/amd: Fix sleeping in atomic in increase_address_space()") failed to keep the "return false", which in 4.9 needs to be a regular "return" due to a lack of commit f15d9a992f90 ("iommu/amd: Remove domain->updated"). This resolves the warning and matches the 4.14-4.19 backport. Cc: Andrey Ryabinin Cc: Joerg Roedel Cc: Will Deacon Fixes: 1d648460d7c5 ("iommu/amd: Fix sleeping in atomic in increase_address_space()") Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Acked-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -1333,7 +1333,7 @@ static void increase_address_space(struc pte = (void *)get_zeroed_page(gfp); if (!pte) - goto out; + return; spin_lock_irqsave(&domain->lock, flags);