diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-08-08 16:52:35 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-16 12:16:42 -0500 |
commit | 2c48b9c45579a9b5e3e74694eebf3d2451f3dbd3 (patch) | |
tree | cecbf786ae0650368a8136bdd90910e05d9b95c3 /ipc | |
parent | a95161aaa801c18c52b2e7cf3d6b4b141c00a20a (diff) |
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 <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/shm.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -878,8 +878,8 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) | |||
878 | if (err) | 878 | if (err) |
879 | goto out_unlock; | 879 | goto out_unlock; |
880 | 880 | ||
881 | path.dentry = dget(shp->shm_file->f_path.dentry); | 881 | path = shp->shm_file->f_path; |
882 | path.mnt = shp->shm_file->f_path.mnt; | 882 | path_get(&path); |
883 | shp->shm_nattch++; | 883 | shp->shm_nattch++; |
884 | size = i_size_read(path.dentry->d_inode); | 884 | size = i_size_read(path.dentry->d_inode); |
885 | shm_unlock(shp); | 885 | shm_unlock(shp); |
@@ -889,8 +889,8 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) | |||
889 | if (!sfd) | 889 | if (!sfd) |
890 | goto out_put_dentry; | 890 | goto out_put_dentry; |
891 | 891 | ||
892 | file = alloc_file(path.mnt, path.dentry, f_mode, | 892 | file = alloc_file(&path, f_mode, |
893 | is_file_hugepages(shp->shm_file) ? | 893 | is_file_hugepages(shp->shm_file) ? |
894 | &shm_file_operations_huge : | 894 | &shm_file_operations_huge : |
895 | &shm_file_operations); | 895 | &shm_file_operations); |
896 | if (!file) | 896 | if (!file) |
@@ -950,7 +950,7 @@ out_unlock: | |||
950 | out_free: | 950 | out_free: |
951 | kfree(sfd); | 951 | kfree(sfd); |
952 | out_put_dentry: | 952 | out_put_dentry: |
953 | dput(path.dentry); | 953 | path_put(&path); |
954 | goto out_nattch; | 954 | goto out_nattch; |
955 | } | 955 | } |
956 | 956 | ||