Re: [PATCH rdma-next] RDMA/uverbs: Optimize clearing of extra bytes in response

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 10, 2018 at 11:35:34AM +0200, Leon Romanovsky wrote:
> +	if (resp_len < attrs->ucore.outlen)
> +		/*
> +		 * Zero fill any extra memory that user
> +		 * space might have provided.
> +		 */
> +		ret = clear_user(attrs->ucore.outbuf + resp_len,
> +				 attrs->ucore.outlen - resp_len);
>  
> -	return 0;
> +	return (ret) ? -EFAULT : 0;

This would be nicer to stay as return 0 so we don't have to have extra
branches on the fast path. Code is clearer that way too..

Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux