提交 c2b96929 编写于 作者: D Dan Carpenter 提交者: Chris Mason

Btrfs: handle kmalloc() failure in inode lookup ioctl

Return -ENOMEM if kmalloc() fails.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 683be16e
......@@ -1211,6 +1211,9 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file,
return -EPERM;
args = kmalloc(sizeof(*args), GFP_KERNEL);
if (!args)
return -ENOMEM;
if (copy_from_user(args, argp, sizeof(*args))) {
kfree(args);
return -EFAULT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册