Commit b540de9
smb: client: fix refcount leak in smb2_set_path_attr
Fix refcount leak in `smb2_set_path_attr` when path conversion fails.
Function `cifs_get_writable_path` returns `cfile` with its reference
counter `cfile->count` increased on success. Function `smb2_compound_op`
would decrease the reference counter for `cfile`, as stated in its
comment. By calling `smb2_rename_path`, the reference counter of `cfile`
would leak if `cifs_convert_path_to_utf16` fails in `smb2_set_path_attr`.
Fixes: 8de9e86 ("cifs: create a helper to find a writeable handle by path name")
Acked-by: Henrique Carvalho <[email protected]>
Signed-off-by: Shuhao Fu <[email protected]>
Signed-off-by: Steve French <[email protected]>1 parent 734e996 commit b540de9
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1294 | 1294 | | |
1295 | 1295 | | |
1296 | 1296 | | |
| 1297 | + | |
| 1298 | + | |
1297 | 1299 | | |
1298 | 1300 | | |
1299 | 1301 | | |
| |||
0 commit comments