Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2252775imc; Fri, 22 Feb 2019 22:37:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IZRV67W1MtIlh0zgn0QDeucf9QP68x+9HYiyL1BuCD40JJuYu0J2z7LK/Fq0J9bwYPv9u5W X-Received: by 2002:a62:5687:: with SMTP id h7mr8094219pfj.198.1550903823314; Fri, 22 Feb 2019 22:37:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550903823; cv=none; d=google.com; s=arc-20160816; b=xVzuTxdHBK3gCFQCBUvmsYJGb420QIJRZFNh1qJbuzAg3ZOnbg08NcUqUfMXNHCMWk hYUrvxBqD4QJvGBFsklNEHYAICF1A+kgRa29ZnNk4XPAgHm4eYCmom/fVIrfQljhkfa5 4eWV3LXYcBCuCSXINEJEszrGTxJaYUHWv4/eKJRrlvUaX5BXXoeVyB3A9kcAWETA8ra9 J9zrnfrcLkssB4kZNYTSXdGbv8t2kCi1SwtXMNlnEed76eA04unNbk1SlQtIZoa9w6Ht Kztfb2kjOEfL6r0sRv0/LmKC/A/MvQTXo7rdiOdEBYdx6Zw9EEGxUrm4hW6Wv3lKXfmq lhQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=yhOgIfVhgUxGNA3/y93NZzblYSFJxAnLZ4az1Uovz+g=; b=hidhHVXawxpWWrBtXdbHWWImr11hoNvy27Wcg7mEhrPScx+DdXnY2Ur2lCKqz0ijqs 2eX/sLsyEfBlCf7fqNq2V4PJto8JBgTjRdIMBqiXVh91bL2ICj3Fc4UotTjMMqQlIs8k IcBSuzEVtlJXcHsKDgbwKg7/753jkYElLhSo2LwQj5AkL40PvaGtz/JfdtUtBgQBJOr4 IVb3FzcgLosGo3KGHhQEOPvU6QbY1AAQPxdXUOZrh2OVhXHMUd+DrgKsXalx7eIxvktX 1DFFtDwI/tN+5wJPZxTpQqsoTb8QUu2oI3b5H7RrEyip51a13yJDdyNesJFf74gzs91D Z/eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="rjb+/2w2"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si3118756pls.73.2019.02.22.22.36.48; Fri, 22 Feb 2019 22:37:03 -0800 (PST) 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=@google.com header.s=20161025 header.b="rjb+/2w2"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727870AbfBWGfz (ORCPT + 99 others); Sat, 23 Feb 2019 01:35:55 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:44029 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726631AbfBWGfz (ORCPT ); Sat, 23 Feb 2019 01:35:55 -0500 Received: by mail-ot1-f67.google.com with SMTP id n71so3791928ota.10 for ; Fri, 22 Feb 2019 22:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=yhOgIfVhgUxGNA3/y93NZzblYSFJxAnLZ4az1Uovz+g=; b=rjb+/2w2PubEGHI9lliFmVPoFeNasdkJCgxE/2BySo9p4LpVxc8wZn+GyDpMxmmfUF 0Pti/QbQ1y61AV9qVdT62xQelKgS5bn7luAnZKkc/J9x80tajd4eBFtPnGFqm/j4Gr+H u6NyvXrZ+FKzzU4mGJInLoR0QVTc/SPdqZsJ3v1QZ272YkjBnP0zUSdT1syIAMcDDcb9 Q8yq31NXt9uvXpbqdtJLyaLVGIUD3h0McapYgi1EfQhynpA3mbhNzueTag3g2R34h6Tt SjmE7USfjl2LgKC2jGG5y+7hk9mGNfunxYrq4PJ7+MDcMNRU2wuMLmyAMHHWPG+kkwqt VClA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=yhOgIfVhgUxGNA3/y93NZzblYSFJxAnLZ4az1Uovz+g=; b=MnstL2VOhA0/el0IeUzXBKsvj+zDx2NXMne9aar2bCD4Op/zH84JpZOausnXnSXr1B rTsZj4x1mM5ivmMjXIdvsPRt6hr9uH6GTbHqRRnj2zMKzeR8rLZ55s9dczM2kmanTi6y bbqA6mQGF7hA0MDMhVw6Uf3wGKof06wPLs5DJQ+Tyf3c5F/T+QX8ucwPr/vzYMluWJb9 HtIuUzm9LV5a4Vpn4/K+TyrvXOkdjV8CeFFK8h8ZLI1kvwiUL8ft5ErMuYVnm3dm+xVN yIfWiLzu30/S70vS8+JaA7WYh//MaganQHkpWsG2lW0JSRk3mVgDCDS+oFy07zMjQRhV TF7A== X-Gm-Message-State: AHQUAuYungQHcbpaH7KywdkA9uIkT1M36rxSKmtXG+P7Jner9Xl/oaik fHmcoHZw37WqtlASadV8dgTnAg== X-Received: by 2002:a9d:4b13:: with SMTP id q19mr5304066otf.304.1550903753684; Fri, 22 Feb 2019 22:35:53 -0800 (PST) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id c24sm1510112otl.67.2019.02.22.22.35.52 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Feb 2019 22:35:52 -0800 (PST) Date: Fri, 22 Feb 2019 22:35:32 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Linus Torvalds cc: "Darrick J. Wong" , Andrew Morton , Matej Kupljen , Al Viro , Dan Carpenter , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH] tmpfs: fix uninitialized return value in shmem_link In-Reply-To: <20190221222123.GC6474@magnolia> Message-ID: References: <20190221222123.GC6474@magnolia> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Darrick J. Wong" When we made the shmem_reserve_inode call in shmem_link conditional, we forgot to update the declaration for ret so that it always has a known value. Dan Carpenter pointed out this deficiency in the original patch. Fixes: 1062af920c07 ("tmpfs: fix link accounting when a tmpfile is linked in") Reported-by: Dan Carpenter Signed-off-by: Darrick J. Wong Signed-off-by: Hugh Dickins --- mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 0905215fb016..2c012eee133d 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2848,7 +2848,7 @@ static int shmem_create(struct inode *dir, struct dentry *dentry, umode_t mode, static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) { struct inode *inode = d_inode(old_dentry); - int ret; + int ret = 0; /* * No ordinary (disk based) filesystem counts links as inodes;