On Fri, Apr 05, 2013 at 09:05:03AM -0400, Josef Bacik wrote:
> On Fri, Apr 05, 2013 at 05:38:16AM -0600, Jan Schmidt wrote:
> > +static long btrfs_ioctl_quota_rescan_status(struct file *file, void __user *arg)
> > +{
> > + struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
> > + struct btrfs_ioctl_quota_rescan_args *qsa;
> > + int ret = 0;
> > +
> > + if (!capable(CAP_SYS_ADMIN))
> > + return -EPERM;
> > +
> > + qsa = kzalloc(sizeof(*qsa), GFP_NOFS);
> > + if (IS_ERR(qsa))
> > + return PTR_ERR(qsa);
> > +
>
> IIRC kzalloc returns NULL if something was wrong, not an ERR_PTR(). Thanks,
And we can get rid of kzalloc/kfree entirely,
btrfs_ioctl_quota_rescan_args is only 2x u64.
david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html