diff mbox series

ksmbd: return a literal instead of 'err' in ksmbd_vfs_kern_path_locked()

Message ID 20230530125757.12910-4-linkinjeon@kernel.org (mailing list archive)
State New, archived
Headers show
Series ksmbd: return a literal instead of 'err' in ksmbd_vfs_kern_path_locked() | expand

Commit Message

Namjae Jeon May 30, 2023, 12:57 p.m. UTC
Return a literal instead of 'err' in ksmbd_vfs_kern_path_locked().

Fixes: 74d7970febf7 ("ksmbd: fix racy issue from using ->d_parent and ->d_name")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
---
 fs/smb/server/vfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dan Carpenter May 30, 2023, 2:01 p.m. UTC | #1
On Tue, May 30, 2023 at 09:57:57PM +0900, Namjae Jeon wrote:
> Return a literal instead of 'err' in ksmbd_vfs_kern_path_locked().
> 
> Fixes: 74d7970febf7 ("ksmbd: fix racy issue from using ->d_parent and ->d_name")

No need for a Fixes tag.

regards,
dan carpenter
Namjae Jeon May 30, 2023, 2:12 p.m. UTC | #2
2023-05-30 23:01 GMT+09:00, Dan Carpenter <dan.carpenter@linaro.org>:
> On Tue, May 30, 2023 at 09:57:57PM +0900, Namjae Jeon wrote:
>> Return a literal instead of 'err' in ksmbd_vfs_kern_path_locked().
>>
>> Fixes: 74d7970febf7 ("ksmbd: fix racy issue from using ->d_parent and
>> ->d_name")
>
> No need for a Fixes tag.
OK.

Thanks.
>
> regards,
> dan carpenter
>
>
diff mbox series

Patch

diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index f9fb778247e7..4f14f111a367 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -1161,7 +1161,7 @@  int ksmbd_vfs_kern_path_locked(struct ksmbd_work *work, char *name,
 
 	err = ksmbd_vfs_path_lookup_locked(share_conf, name, flags, path);
 	if (!err)
-		return err;
+		return 0;
 
 	if (caseless) {
 		char *filepath;