diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2009-01-25 21:53:00 -0500 |
---|---|---|
committer | Felix Blyakher <felixb@sgi.com> | 2009-01-27 15:51:39 -0500 |
commit | f0e0059b9c18426cffdcc04161062251a8f9741e (patch) | |
tree | 961ac9a97f77e55cd76d56f1f931caf8ac6f4114 /fs/xfs | |
parent | 74e2d06521913443c7e2697037909f5efc200ec5 (diff) |
don't reallocate sxp variable passed into xfs_swapext
fixes kernel.org bugzilla 12538, xfs_fsr fails on 2.6.29-rc kernels
Regression caused by 743bb4650da9e2595d6cedd01c680b5b9398c74a
This was an embarrasing mistake, reallocating the sxp pointer passed
in from the main ioctl switch.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net
Reported-by: Paul Martin <pm@debian.org>
Tested-by: Paul Martin <pm@debian.org>
Reviewed-by: Felix Blyakher <felixb@sgi.com>
Signed-off-by: Felix Blyakher <felixb@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_dfrag.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index b4c1ee713492..f8278cfcc1d3 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c | |||
@@ -55,17 +55,11 @@ xfs_swapext( | |||
55 | struct file *file, *target_file; | 55 | struct file *file, *target_file; |
56 | int error = 0; | 56 | int error = 0; |
57 | 57 | ||
58 | sxp = kmem_alloc(sizeof(xfs_swapext_t), KM_MAYFAIL); | ||
59 | if (!sxp) { | ||
60 | error = XFS_ERROR(ENOMEM); | ||
61 | goto out; | ||
62 | } | ||
63 | |||
64 | /* Pull information for the target fd */ | 58 | /* Pull information for the target fd */ |
65 | file = fget((int)sxp->sx_fdtarget); | 59 | file = fget((int)sxp->sx_fdtarget); |
66 | if (!file) { | 60 | if (!file) { |
67 | error = XFS_ERROR(EINVAL); | 61 | error = XFS_ERROR(EINVAL); |
68 | goto out_free_sxp; | 62 | goto out; |
69 | } | 63 | } |
70 | 64 | ||
71 | if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND)) { | 65 | if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND)) { |
@@ -109,8 +103,6 @@ xfs_swapext( | |||
109 | fput(target_file); | 103 | fput(target_file); |
110 | out_put_file: | 104 | out_put_file: |
111 | fput(file); | 105 | fput(file); |
112 | out_free_sxp: | ||
113 | kmem_free(sxp); | ||
114 | out: | 106 | out: |
115 | return error; | 107 | return error; |
116 | } | 108 | } |