Commit 62e5396
committed
smb: avoid pointless cred reference count bump
The creds are allocated via prepare_kernel_cred() which has already
taken a reference.
This also removes a pointless check that gives the impression that
override_creds() can ever be called on a task with current->cred NULL.
That's not possible afaict. Remove the check to not imply that there can
be a dangling pointer in current->cred.
Link: https://lore.kernel.org/r/20241125-work-cred-v2-21-68b9d38bb5b2@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>1 parent 2b315ed commit 62e5396
1 file changed
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
| 783 | + | |
788 | 784 | | |
789 | 785 | | |
790 | 786 | | |
| |||
796 | 792 | | |
797 | 793 | | |
798 | 794 | | |
799 | | - | |
800 | 795 | | |
801 | 796 | | |
802 | | - | |
803 | | - | |
804 | | - | |
| 797 | + | |
805 | 798 | | |
| 799 | + | |
806 | 800 | | |
807 | 801 | | |
808 | 802 | | |
| |||
0 commit comments