diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 630f781aeb190b59851324f18afeb94b343e5180..c55459c592b855f04bd2aeb180d06df04ae0a4d8 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -183,7 +183,9 @@ static int spidev_message(struct spidev_data *spidev, if (u_tmp->rx_buf) { k_tmp->rx_buf = buf; - if (!access_ok(VERIFY_WRITE, u_tmp->rx_buf, u_tmp->len)) + if (!access_ok(VERIFY_WRITE, (u8 __user *) + (ptrdiff_t) u_tmp->rx_buf, + u_tmp->len)) goto done; } if (u_tmp->tx_buf) {