Commit c15e7c6
smb/server: Fix another refcount leak in smb2_open()
If ksmbd_override_fsids() fails, we jump to err_out2. At that point, fp is
NULL because it hasn't been assigned dh_info.fp yet, so ksmbd_fd_put(work,
fp) will not be called. However, dh_info.fp was already inserted into the
session file table by ksmbd_reopen_durable_fd(), so it will leak in the
session file table until the session is closed.
Move fp = dh_info.fp; ahead of the ksmbd_override_fsids() check to fix the
problem.
Found by an experimental AI code review agent at Google.
Fixes: c8efcc7 ("ksmbd: add support for durable handles v1/v2")
Signed-off-by: Guenter Roeck <[email protected]>
Reviewed-by: ChenXiaoSong <[email protected]>
Acked-by: Namjae Jeon <[email protected]>
Signed-off-by: Steve French <[email protected]>1 parent 1f318b9 commit c15e7c6
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3012 | 3012 | | |
3013 | 3013 | | |
3014 | 3014 | | |
| 3015 | + | |
| 3016 | + | |
3015 | 3017 | | |
3016 | 3018 | | |
3017 | 3019 | | |
3018 | 3020 | | |
3019 | 3021 | | |
3020 | 3022 | | |
3021 | | - | |
3022 | 3023 | | |
3023 | 3024 | | |
3024 | 3025 | | |
| |||
0 commit comments