Skip to content

Commit 978336d

Browse files
Wolfram SangWolfram Sang
authored andcommitted
i2c: dev: mark RDWR buffers as DMA_SAFE
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent e94bc5d commit 978336d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/i2c/i2c-dev.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ static noinline int i2cdev_ioctl_rdwr(struct i2c_client *client,
264264
res = PTR_ERR(msgs[i].buf);
265265
break;
266266
}
267+
/* memdup_user allocates with GFP_KERNEL, so DMA is ok */
268+
msgs[i].flags |= I2C_M_DMA_SAFE;
267269

268270
/*
269271
* If the message length is received from the slave (similar

0 commit comments

Comments
 (0)