aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/shm.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-08-08 16:52:35 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-12-16 12:16:42 -0500
commit2c48b9c45579a9b5e3e74694eebf3d2451f3dbd3 (patch)
treececbf786ae0650368a8136bdd90910e05d9b95c3 /ipc/shm.c
parenta95161aaa801c18c52b2e7cf3d6b4b141c00a20a (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/shm.c')
-rw-r--r--ipc/shm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 11bec626c228..16e39230aa0d 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -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:
950out_free: 950out_free:
951 kfree(sfd); 951 kfree(sfd);
952out_put_dentry: 952out_put_dentry:
953 dput(path.dentry); 953 path_put(&path);
954 goto out_nattch; 954 goto out_nattch;
955} 955}
956 956