From patchwork Fri May 7 08:27:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 53736 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id AE1CCB7D1A for ; Thu, 27 May 2010 22:35:20 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 4CF4A465D3; Thu, 27 May 2010 06:34:47 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.8 tests=BAYES_00, RCVD_IN_SORBS_WEB, SPF_PASS autolearn=no version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mail-ww0-f41.google.com (mail-ww0-f41.google.com [74.125.82.41]) by lists.samba.org (Postfix) with ESMTP id A7EDAAD2AB; Fri, 7 May 2010 02:27:52 -0600 (MDT) Received: by wwi14 with SMTP id 14so71582wwi.14 for ; Fri, 07 May 2010 01:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=ToWxKRz3zLxej2Jc60xNzhnQTTADyQPw7x9lvoCx3pg=; b=NFWnNB8A0xK+alfTB5XWbGw9sEGPhQCRa96Fp6V55XESIMKjWg2uxYKj/1LVQKv0xG 4IlAUX+Ory97mfGvtGehypx4BGZnAKMsbi+usaa6kuKeLMerMjwIrIVliMmJV7UZQ+QT K7ME7mywE1jr2Y7VNY/yw5gYhjPLdo4gOIQn4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=LQbNQeXNuUZ4gr+FuphgEp+ur4IzendcV/qtMq+lqLq0E9OIH5INpT4Mo0WPDgDhHz VhKPYaKN9XGHUBhYArXzOPBRrOSwsDazR8Cpo5hxIkmCqGg4hFN+bwHtFkZQq9i2x/FA J3aBCQVI1tGgOMUkxGhe830kWjxCBkSCw8wuY= Received: by 10.227.148.11 with SMTP id n11mr5352865wbv.49.1273220868391; Fri, 07 May 2010 01:27:48 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id x34sm8524110wbd.4.2010.05.07.01.27.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 07 May 2010 01:27:48 -0700 (PDT) Date: Fri, 7 May 2010 10:27:44 +0200 From: Dan Carpenter To: Steve French Message-ID: <20100507082744.GR27064@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Mailman-Approved-At: Thu, 27 May 2010 06:34:17 -0600 Cc: samba-technical@lists.samba.org, Jiri Kosina , linux-cifs-client@lists.samba.org, Al Viro Subject: [linux-cifs-client] [patch] cifs: return more accurate errno X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org Smatch compains that we don't use the return value from get_dfs_path(). In the original code if get_dfs_path() fails we return ERR_PTR(-ENOENT), but with this patch we can return errno from get_dfs_path() directly. Signed-off-by: Dan Carpenter --- Compile tested only. Sorry. :/ diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c index 78e4d2a..fa1f74a 100644 --- a/fs/cifs/cifs_dfs_ref.c +++ b/fs/cifs/cifs_dfs_ref.c @@ -345,6 +345,8 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd) rc = get_dfs_path(xid, ses , full_path + 1, cifs_sb->local_nls, &num_referrals, &referrals, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); + if (rc < 0) + goto out_err; for (i = 0; i < num_referrals; i++) { int len;