mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
switch alloc_file() to passing struct path
... and have the caller grab both mnt and dentry; kill leak in infiniband, while we are at it. Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
a95161aaa8
commit
2c48b9c455
11 changed files with 78 additions and 63 deletions
10
ipc/shm.c
10
ipc/shm.c
|
|
@ -878,8 +878,8 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
|
|||
if (err)
|
||||
goto out_unlock;
|
||||
|
||||
path.dentry = dget(shp->shm_file->f_path.dentry);
|
||||
path.mnt = shp->shm_file->f_path.mnt;
|
||||
path = shp->shm_file->f_path;
|
||||
path_get(&path);
|
||||
shp->shm_nattch++;
|
||||
size = i_size_read(path.dentry->d_inode);
|
||||
shm_unlock(shp);
|
||||
|
|
@ -889,8 +889,8 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr)
|
|||
if (!sfd)
|
||||
goto out_put_dentry;
|
||||
|
||||
file = alloc_file(path.mnt, path.dentry, f_mode,
|
||||
is_file_hugepages(shp->shm_file) ?
|
||||
file = alloc_file(&path, f_mode,
|
||||
is_file_hugepages(shp->shm_file) ?
|
||||
&shm_file_operations_huge :
|
||||
&shm_file_operations);
|
||||
if (!file)
|
||||
|
|
@ -950,7 +950,7 @@ out_unlock:
|
|||
out_free:
|
||||
kfree(sfd);
|
||||
out_put_dentry:
|
||||
dput(path.dentry);
|
||||
path_put(&path);
|
||||
goto out_nattch;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue