From patchwork Sun Aug 20 16:40:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9911219 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B5A45600C8 for ; Sun, 20 Aug 2017 16:40:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4AC428749 for ; Sun, 20 Aug 2017 16:40:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9628F2875B; Sun, 20 Aug 2017 16:40:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 338C728749 for ; Sun, 20 Aug 2017 16:40:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753122AbdHTQkK (ORCPT ); Sun, 20 Aug 2017 12:40:10 -0400 Received: from mout.web.de ([212.227.17.11]:49821 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753101AbdHTQkJ (ORCPT ); Sun, 20 Aug 2017 12:40:09 -0400 Received: from [192.168.1.2] ([92.225.240.160]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MEVhF-1dlKoD00gD-00Flmp; Sun, 20 Aug 2017 18:40:08 +0200 Subject: [PATCH 6/8] CIFS: Return directly after a failed build_path_from_dentry() in cifs_do_create() From: SF Markus Elfring To: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, Steve French Cc: LKML , kernel-janitors@vger.kernel.org References: <826310e5-e01c-38af-90df-c5630f761a4d@users.sourceforge.net> Message-ID: <24a10b1a-3b4a-da70-1670-23b4ec9abff8@users.sourceforge.net> Date: Sun, 20 Aug 2017 18:40:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <826310e5-e01c-38af-90df-c5630f761a4d@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:ANcgbUEQOHkTl3JfG1GVcACCdOCyWxPr9fSerxuwvrZDbrOsPaT b+pye5k96U8T4jeSEqXAIzkseVR3dJzXy1dL9fvmXuBAf1FZo5MJKLc30rD7mqVkUEKfNLr rHi+DTaHuLQL6OcA8u4enUiKILHQfkmM7OAIJJoAKRcdzKj5uJRDGWYMtflNgtLjd9xTwnf bc88jV9zErwcPGNRr/GMw== X-UI-Out-Filterresults: notjunk:1; V01:K0:c+Oy74hMNO4=:djGkdv9ojU2uXaKOVCb9Nm 9Obfo/whG74+92j4gZanpDn4/WdGS4UCtjNilkASOXVCTba0UcxSDWTsXUNh3cTnN0eVpwwdw VCCNn7aKo5PTll9SSNt83Ty23WoDc5PBhdoqvAlb/ZeUVjzs0BZ5geCp/F3Nq+gHK4Y0AykJ8 zCryDjO39Xs4faHw89abIWFGy0Arx/OYap9N/N4Pa+ovRTblw7MeFRRSqTSyDzEdujmYLlqip X6hCOJTave7wK2+9/4DcI4+MoqNVlRquqOTP/iyKsLMpTyvqoDx90cY+UI24VUKxXARiyiQn5 WxluCQqBRCk3eqtT1buANDIe2exvdwcMleuzJPVNOPeGT4rc9pwhscrRCx+K6jgmLHOxRkn4g vzRFdeNwGiUDPmasPL03epBUBlBXmNjccE//7qW54E4mmMb8E/iVQDh2JkgQ83tKCIUtRJuCy Y6Km3ODuqBL//8BfTALujuCOhIV6gSX/LaBeQq7zqrhIZMnBtlZ9eJZTHkxMCj/naglZRnb6Z gz/W7ZsKyFIyaVsYhqwl6DMycN1QPVXtYx1mU7uAmduOKgX3P3/KtgIPFlRN/buNBtZZfG99F jTWwUHTFRg9frkcmr+1n9d9VzdsQj1nqmWNY2Lo5+8Z0PJCrPAgp1eRUsaK26Qo6+aGSFAwor aX6nU0sKszQ/WPClFeaJGembyKZu1hCGhMFdYcNQIA/B/t/Q4ZzXaxTZ9WQBYpm+qy0WCzuOC ajarjhlQG5LKIQUNVreF78VVWeYafJUuCwNkK02/HduifvsZZBWoyPHgXDQxiWS7GZfw7Qn7z 19sGNRcVTuQX4TmEg81z0Artwa1GPDgFpQ9eotV6imtwaRxvDM= Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 20 Aug 2017 17:17:30 +0200 Return directly after a call of the function "build_path_from_dentry" failed at the beginning. Signed-off-by: Markus Elfring --- fs/cifs/dir.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 2c9cbd8393d6..248aead1f3f4 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -239,10 +239,8 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid, *oplock = REQ_OPLOCK; full_path = build_path_from_dentry(direntry); - if (full_path == NULL) { - rc = -ENOMEM; - goto out; - } + if (!full_path) + return -ENOMEM; if (tcon->unix_ext && cap_unix(tcon->ses) && !tcon->broken_posix_open && (CIFS_UNIX_POSIX_PATH_OPS_CAP &