[PATCH] staging: lustre: return error if copy_to_user fails

Dan Carpenter dan.carpenter at oracle.com
Thu May 14 11:11:18 UTC 2015


On Thu, May 14, 2015 at 10:58:44AM +0000, Drokin, Oleg wrote:
> So I imagine the only case where this could fail is if we got a pointer to some read-only location
> (or there's somebody playing with mappings behind our back?) so it should be totally fine to
> do it the other way around:
> 
> rc = -EOVERFLOW;
> if (copy_to_user(lump, &lum, lum_size))
> 	rc = -EFAULT;
> 
> goto out_set;
> 

Let's just leave it as-is.  The original code is fine.

regards,
dan carpenter



More information about the devel mailing list