diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-09-03 20:44:04 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-09-08 10:00:52 -0300 |
commit | 04da2daee383391954b34e7d0fe0281d75447d61 (patch) | |
tree | bd5e08c06fb73f2fda5f4199b00b91ecefc8d9d4 /drivers/media/pci/ngene | |
parent | ce9e1ac1b9becb9481f8492d9ccf713398a07ef8 (diff) | |
download | linux-04da2daee383391954b34e7d0fe0281d75447d61.tar.bz2 |
[media] ngene: properly handle __user ptr
Sparse is complaining about ngene's bad usage of a __user ptr:
>> drivers/media/pci/ngene/ngene-dvb.c:62:48: sparse: incorrect type in argument 2 (different address spaces)
drivers/media/pci/ngene/ngene-dvb.c:62:48: expected unsigned char const [usertype] *buf
drivers/media/pci/ngene/ngene-dvb.c:62:48: got char const [noderef] <asn:1>*buf
As this is intercepting a .write() file ops, we can't just memcpy. We need to use
copy_from_user.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/pci/ngene')
-rw-r--r-- | drivers/media/pci/ngene/ngene-dvb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/pci/ngene/ngene-dvb.c b/drivers/media/pci/ngene/ngene-dvb.c index a8a4045f66d7..59bb2858c8d0 100644 --- a/drivers/media/pci/ngene/ngene-dvb.c +++ b/drivers/media/pci/ngene/ngene-dvb.c @@ -59,7 +59,7 @@ static ssize_t ts_write(struct file *file, const char __user *buf, (&dev->tsout_rbuf) >= count) < 0) return 0; - dvb_ringbuffer_write(&dev->tsout_rbuf, buf, count); + dvb_ringbuffer_write_user(&dev->tsout_rbuf, buf, count); return count; } |