Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 173c8401 authored by Al Viro's avatar Al Viro
Browse files

switch fchmod() to fdget



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 7e3fb584
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -485,14 +485,13 @@ out_unlock:

SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode)
{
	struct file * file;
	struct fd f = fdget(fd);
	int err = -EBADF;

	file = fget(fd);
	if (file) {
		audit_inode(NULL, file->f_path.dentry, 0);
		err = chmod_common(&file->f_path, mode);
		fput(file);
	if (f.file) {
		audit_inode(NULL, f.file->f_path.dentry, 0);
		err = chmod_common(&f.file->f_path, mode);
		fdput(f);
	}
	return err;
}