提交 f0e0059b 编写于 作者: E Eric Sandeen 提交者: Felix Blyakher

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 743bb465

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: NPaul Martin <pm@debian.org>
Tested-by: NPaul Martin <pm@debian.org>
Reviewed-by: NFelix Blyakher <felixb@sgi.com>
Signed-off-by: NFelix Blyakher <felixb@sgi.com>
上级 74e2d065
......@@ -55,17 +55,11 @@ xfs_swapext(
struct file *file, *target_file;
int error = 0;
sxp = kmem_alloc(sizeof(xfs_swapext_t), KM_MAYFAIL);
if (!sxp) {
error = XFS_ERROR(ENOMEM);
goto out;
}
/* Pull information for the target fd */
file = fget((int)sxp->sx_fdtarget);
if (!file) {
error = XFS_ERROR(EINVAL);
goto out_free_sxp;
goto out;
}
if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND)) {
......@@ -109,8 +103,6 @@ xfs_swapext(
fput(target_file);
out_put_file:
fput(file);
out_free_sxp:
kmem_free(sxp);
out:
return error;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册