Btrfs: check return of kmalloc in btrfs_control_ioctl
PATCH 1/1 Btrfs: check return of kmalloc in btrfs_control_ioctl
The memory allocated by kmalloc should be checked before using it.
Signed-off-by Shen Feng <[email protected]>
--- fs/btrfs/super.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
fs/btrfs/super.c +2 -0
@@ -590,6 +590,8 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,int len; vol =kmalloc (sizeof (*vol),GFP_KERNEL ); +if (!vol) +return -ENOMEM ;if (copy_from_user (vol, (void __user *)arg,sizeof (*vol))) { ret = -EFAULT ; goto out;
Signature · 1 line
1.6.0.6