camera: fix Out-of-bounds error from Coverity tool [1/1]

PD#SWPL-16538

Problem:
Out-of-bounds error

Solution:
fix Out-of-bounds error

Verify:
verified on w400

Change-Id: I5907acba3f180f5a7cf5417840d2aa5f0f19005b
Signed-off-by: dong.wei <dong.wei@amlogic.com>
This commit is contained in:
dong.wei
2019-11-25 14:11:58 +08:00
committed by Chris
parent 7fc3136540
commit c763acf442

View File

@@ -147,13 +147,10 @@ static ssize_t mirror_read(struct class *cla, struct class_attribute *attr,
static ssize_t mirror_write(struct class *cla,
struct class_attribute *attr,
const char *buf, size_t count)
{
ssize_t size;
char *endp = "1";
const char *buf, size_t count){
unsigned long endp;
camera_mirror_flag = kstrtoul(buf, 0, (unsigned long *)endp);
size = endp - buf;
camera_mirror_flag = kstrtoul(buf, 0, &endp);
return count;
}