[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210504124343.22611-1-khaledromdhani216@gmail.com>
Date: Tue, 4 May 2021 13:43:43 +0100
From: Khaled ROMDHANI <khaledromdhani216@...il.com>
To: sfrench@...ba.org
Cc: Khaled ROMDHANI <khaledromdhani216@...il.com>,
linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH-next] fs/cifs: Fix resource leak
The -EIO error return path is leaking memory allocated
to page. Fix this by invoking the free_dentry_path before
the return.
Addresses-Coverity: ("Resource leak")
Signed-off-by: Khaled ROMDHANI <khaledromdhani216@...il.com>
---
fs/cifs/link.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 1cbe7ec73728..1485c6095ba1 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -686,8 +686,10 @@ cifs_symlink(struct user_namespace *mnt_userns, struct inode *inode,
void *page = alloc_dentry_path();
struct inode *newinode = NULL;
- if (unlikely(cifs_forced_shutdown(cifs_sb)))
+ if (unlikely(cifs_forced_shutdown(cifs_sb))) {
+ free_dentry_path(page);
return -EIO;
+ }
xid = get_xid();
--
2.17.1
Powered by blists - more mailing lists