projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
39d9ebd
)
vpu_service: add reg_size check on reg_init
author
chm
<chm@rock-chips.com>
Wed, 8 May 2013 06:18:00 +0000
(14:18 +0800)
committer
chm
<chm@rock-chips.com>
Wed, 8 May 2013 06:18:00 +0000
(14:18 +0800)
arch/arm/plat-rk/vpu_service.c
patch
|
blob
|
history
diff --git
a/arch/arm/plat-rk/vpu_service.c
b/arch/arm/plat-rk/vpu_service.c
index 8767e19dfc240713eaba143f8b556694faa4ab34..5fa902ab3626c17f30b37f9c8c2543196624f57e 100644
(file)
--- a/
arch/arm/plat-rk/vpu_service.c
+++ b/
arch/arm/plat-rk/vpu_service.c
@@
-439,6
+439,10
@@
static vpu_reg *reg_init(vpu_session *session, void __user *src, unsigned long s
return NULL;
}
return NULL;
}
+ if (size > service.reg_size) {
+ printk("warning: vpu reg size %lu is larger than hw reg size %lu\n", size, service.reg_size);
+ size = service.reg_size;
+ }
reg->session = session;
reg->type = session->type;
reg->size = size;
reg->session = session;
reg->type = session->type;
reg->size = size;
@@
-807,7
+811,6
@@
static long vpu_service_ioctl(struct file *filp, unsigned int cmd, unsigned long
pr_err("error: VPU_IOC_SET_REG copy_from_user failed\n");
return -EFAULT;
}
pr_err("error: VPU_IOC_SET_REG copy_from_user failed\n");
return -EFAULT;
}
-
reg = reg_init(session, (void __user *)req.req, req.size);
if (NULL == reg) {
return -EFAULT;
reg = reg_init(session, (void __user *)req.req, req.size);
if (NULL == reg) {
return -EFAULT;