Re: [PATCH] staging: lustre: Mark userspace pointer types in ksocknal_recv_iov()

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

 



On Fri, Sep 12, 2014 at 11:45:44PM +1000, Artemiy Volkov wrote:

> --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
> +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
> @@ -281,7 +281,8 @@ ksocknal_recv_iov (ksock_conn_t *conn)
>  
>  		if (nob < (int)iov->iov_len) {
>  			iov->iov_len -= nob;
> -			iov->iov_base = (void *)((char *)iov->iov_base + nob);
> +			iov->iov_base = (void __user *)
> +					((char __user *)iov->iov_base + nob);

->iob_base is a void __user pointer so you can just do:

			iov->iov_base += nob;

Much simpler.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux