Skip to contentSkip to conversation

cifs: Fix missed free operations

PATCH Applied Chuhong Yuan 3 participants 3 messages Oct 14, 2019 – Oct 15, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: Fix missed free operations

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.

Fixes aa081859b10c ("cifs: flush before set-info if we have writeable handles")
---
 fs/cifs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/inode.c +2 -2
index 5dcc95b38310..df9377828e2f 100644
@@ -2475,9 +2475,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;
 	}
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

пн, 14 окт. 2019 г. в 00:18, Chuhong Yuan <[email protected]>:

Quoted 28 lines

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.

Fixes aa081859b10c ("cifs: flush before set-info if we have writeable handles")
---
 fs/cifs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/inode.c +2 -3
index 5dcc95b38310..df9377828e2f 100644
@@ -2475,9 +2475,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;
        }
--
Quoted 2 lines

2.20.1

Looks good, thanks.

The original patch was tagged for stable, so, it seems that this one should be tagged too.

--
Best regards,
Pavel Shilovsky

Applied
#2 lore raw

Merged into cifs-2.6.git for-next and cc: stable for 5.3

Quoted 44 lines · Pavel Shilovsky via samba-technical

пн, 14 окт. 2019 г. в 00:18, Chuhong Yuan <[email protected]>:

Quoted 28 lines

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.

Fixes aa081859b10c ("cifs: flush before set-info if we have writeable handles")
---
 fs/cifs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/inode.c +2 -3
index 5dcc95b38310..df9377828e2f 100644
@@ -2475,9 +2475,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;
        }
--
Quoted 2 lines

2.20.1

Looks good, thanks.

The original patch was tagged for stable, so, it seems that this one should be tagged too.

--
Best regards,
Pavel Shilovsky

Signature · 3 lines
Thanks,

Steve