Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2249660ybd; Mon, 24 Jun 2019 03:17:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqypVdCY8KFMGmnDSTyOSw7LXA/MW8YNhRTRdgKFZ15p42LMexK23pkVYPUHZY7awIil81On X-Received: by 2002:a63:8d4a:: with SMTP id z71mr21563254pgd.346.1561371458566; Mon, 24 Jun 2019 03:17:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371458; cv=none; d=google.com; s=arc-20160816; b=LJp+uM5tRRXIH6BuH2H8I+m0WcJ2MADjmrcPYqEdyxk7w3YQT7dxQOx1HjQe7WVtLv 9DHt3kd+YuxtvqKxLCEhGrsVyc4N4/0q2YxlD0nI5OArjqdqHnb0wcAS5cxtrBH4JMxU MJcuMDl0MCp7E0cgB2FPZbqV4V+3zyrQvY5Fl2IC39utHjCxwnPxjaCSwJ3wUBRgDj5M V7areBPm4zDrBS3dbOT7/YCXpO31SsFH8O/apgcjdRRuDOVuVsOzBLLNtHk2nqn9T4y3 ezVG0G7xQOB7rUx6nnraJ6E5vFusdMSBqz2DMfQnqZX8b2kDzdUVde6bgWFcV09xCxhL GbYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pIrqq4Sm6WOPiNntIsXQUF7E9gN9Js9hVVpsT8X2deE=; b=Qd4mKPqGG6l7/EbMtUTjcVDJw9LkxaHotxCtZ1blYuOi7pC5CP4Ovbcqfp1I1i8cD5 uB2pIMcEU14r3trkvF17J/ewbtsIYA/tzux+3Dox/kLAG1tL5x5aF5eansxyqbQSny+4 XDx7LUdMyKGHsAkzxMr/jbEH1w5QtKv/3uYvpW9Q2j7+OCenh0GSDKQSU6MAhVbZ1Vb1 QrGcdT4TLf7u5ok40bSiBW7RwoNJb1jesHJPMQNtZ4ZXsJNesgs1i4t2B1nqFwwhJc90 40cz4mlufsgrSaMlpdD7rKMbsnZZP+S6hB8d3WpgEEGGO/kWf3FR6FUJQxIjj79xWCxo 9P6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qHL+c0vR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j93si9917324plb.32.2019.06.24.03.17.22; Mon, 24 Jun 2019 03:17:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qHL+c0vR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730802AbfFXKQt (ORCPT + 99 others); Mon, 24 Jun 2019 06:16:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:54308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730781AbfFXKQq (ORCPT ); Mon, 24 Jun 2019 06:16:46 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B74A2146E; Mon, 24 Jun 2019 10:16:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371406; bh=mOxxpGB/oDd0cH0mmpuJKpZv7IMSYaE70omrEujUuis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qHL+c0vRRFrJ2IFm9MOYFj866JDTw9TR54euwaZAYEJEK+a9iv2Kj3nzsW2Z+yzbE sPSGuHYFKNqBje0iL48/gu+uQlpnLFLr/SGrkAPwrEVr848CB4rjIWJ3cf6TFfZ4dL ovmpSWBCpAsh6VWSskgruCMsKRF3YyFHCIFZMh6o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Miklos Szeredi , Sasha Levin Subject: [PATCH 5.1 091/121] ovl: fix bogus -Wmaybe-unitialized warning Date: Mon, 24 Jun 2019 17:57:03 +0800 Message-Id: <20190624092325.446437178@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 1dac6f5b0ed2601be21bb4e27a44b0c3e667b7f4 ] gcc gets a bit confused by the logic in ovl_setup_trap() and can't figure out whether the local 'trap' variable in the caller was initialized or not: fs/overlayfs/super.c: In function 'ovl_fill_super': fs/overlayfs/super.c:1333:4: error: 'trap' may be used uninitialized in this function [-Werror=maybe-uninitialized] iput(trap); ^~~~~~~~~~ fs/overlayfs/super.c:1312:17: note: 'trap' was declared here Reword slightly to make it easier for the compiler to understand. Fixes: 146d62e5a586 ("ovl: detect overlapping layers") Signed-off-by: Arnd Bergmann Signed-off-by: Miklos Szeredi Signed-off-by: Sasha Levin --- fs/overlayfs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index fa5060f59b88..9780617c69ee 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -996,8 +996,8 @@ static int ovl_setup_trap(struct super_block *sb, struct dentry *dir, int err; trap = ovl_get_trap_inode(sb, dir); - err = PTR_ERR(trap); - if (IS_ERR(trap)) { + err = PTR_ERR_OR_ZERO(trap); + if (err) { if (err == -ELOOP) pr_err("overlayfs: conflicting %s path\n", name); return err; -- 2.20.1