Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sev-dev: use guard for path

Just use a guard and also move the path_put() out of the credential
change's scope. There's no need to do this with the overridden
credentials.

Link: https://patch.msgid.link/20251103-work-creds-guards-prepare_creds-v1-2-b447b82f2c9b@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

+1 -2
+1 -2
drivers/crypto/ccp/sev-dev.c
··· 259 259 260 260 static struct file *open_file_as_root(const char *filename, int flags, umode_t mode) 261 261 { 262 + struct path root __free(path_put) = {}; 262 263 struct file *fp; 263 - struct path root; 264 264 struct cred *cred; 265 265 const struct cred *old_cred; 266 266 ··· 275 275 old_cred = override_creds(cred); 276 276 277 277 fp = file_open_root(&root, filename, flags, mode); 278 - path_put(&root); 279 278 280 279 put_cred(revert_creds(old_cred)); 281 280