Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751979AbdFNJav (ORCPT ); Wed, 14 Jun 2017 05:30:51 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:36493 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730AbdFNJad (ORCPT ); Wed, 14 Jun 2017 05:30:33 -0400 Date: Wed, 14 Jun 2017 12:30:02 +0300 From: Dan Carpenter To: "J. Bruce Fields" Cc: David Howells , NeilBrown , Al Viro , Ingo Molnar , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] reconnect_one(): fix a missing error code Message-ID: <20170614093002.GG29394@elgon.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 865 Lines: 22 I found this bug by reviewing places where we do ERR_PTR(0) (which is NULL). We used to return an error pointer if lookup_one_len() failed but we moved this code into a helper function and accidentally removed that. NULL is a valid return for this function but it's not what we intended. Fixes: bbf7a8a3562f ("exportfs: move most of reconnect_path to helper function") Signed-off-by: Dan Carpenter diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index 329a5d103846..451237745689 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c @@ -147,6 +147,7 @@ static struct dentry *reconnect_one(struct vfsmount *mnt, tmp = lookup_one_len_unlocked(nbuf, parent, strlen(nbuf)); if (IS_ERR(tmp)) { dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp)); + err = PTR_ERR(tmp); goto out_err; } if (tmp != dentry) {