| From 72984c78e569eb55c9c03956576e71f47a1b8375 Mon Sep 17 00:00:00 2001 |
| From: Chuhong Yuan <hslester96@gmail.com> |
| Date: Mon, 14 Oct 2019 15:15:31 +0800 |
| Subject: [PATCH] cifs: Fix missed free operations |
| |
| commit 783bf7b8b641167fb6f3f4f787f60ae62bad41b3 upstream. |
| |
| cifs_setattr_nounix has two paths which miss free operations |
| for xid and fullpath. |
| Use goto cifs_setattr_exit like other paths to fix them. |
| |
| CC: Stable <stable@vger.kernel.org> |
| Fixes: aa081859b10c ("cifs: flush before set-info if we have writeable handles") |
| Signed-off-by: Chuhong Yuan <hslester96@gmail.com> |
| Signed-off-by: Steve French <stfrench@microsoft.com> |
| Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c |
| index 86a63600837e..f2042d1a1cc4 100644 |
| --- a/fs/cifs/inode.c |
| +++ b/fs/cifs/inode.c |
| @@ -2467,9 +2467,9 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) |
| rc = tcon->ses->server->ops->flush(xid, tcon, &wfile->fid); |
| cifsFileInfo_put(wfile); |
| if (rc) |
| - return rc; |
| + goto cifs_setattr_exit; |
| } else if (rc != -EBADF) |
| - return rc; |
| + goto cifs_setattr_exit; |
| else |
| rc = 0; |
| } |
| -- |
| 2.7.4 |
| |