From: Wolfram Sang Date: Sat, 4 Nov 2017 20:20:03 +0000 (+0100) Subject: i2c: dev: mark RDWR buffers as DMA_SAFE X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=978336d48d887d6deb7793e0d20a4673f357fb8e;p=linux.git i2c: dev: mark RDWR buffers as DMA_SAFE Reviewed-by: Jonathan Cameron Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index 2cab27a684798..036a03f0d0a68 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -264,6 +264,8 @@ static noinline int i2cdev_ioctl_rdwr(struct i2c_client *client, res = PTR_ERR(msgs[i].buf); break; } + /* memdup_user allocates with GFP_KERNEL, so DMA is ok */ + msgs[i].flags |= I2C_M_DMA_SAFE; /* * If the message length is received from the slave (similar