[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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user