coverity: fix coverity error. [1/1]

PD#SWPL-23799

Problem:
memory leak.
unchecked return value.

Solution:
free the alloced memory.

Verify:
build pass.

Change-Id: I6d55b582c03bf0f5ac3b871925c8e3f477371137
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
This commit is contained in:
Jianxiong Pan
2020-04-29 19:42:38 +08:00
committed by Chris
parent 58051cb993
commit 11b29ed51b
2 changed files with 4 additions and 1 deletions

View File

@@ -3105,6 +3105,7 @@ static int gc2145_open(struct file *file)
if (retval) {
vm_deinit_resource(&(dev->vminfo));
kfree(fh);
return retval;
}

View File

@@ -3097,8 +3097,10 @@ static int ov5640_open(struct file *file)
}
mutex_unlock(&dev->mutex);
if (retval)
if (retval) {
kfree(fh);
return retval;
}
#ifdef CONFIG_HAS_WAKELOCK
wake_lock(&(dev->wake_lock));