summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinay Kalia <vinaykalia@google.com>2024-01-06 00:00:07 +0000
committerVinay Kalia <vinaykalia@google.com>2024-01-06 00:00:07 +0000
commitd912d091a31cfe27cc74ea43ed6be88d7b585900 (patch)
treec85ae44a6e84c4892bfafea08e6b1422e074d6c2
parentee7a47998a993acdbaf79f14ede967626b2598b9 (diff)
downloadgchips-d912d091a31cfe27cc74ea43ed6be88d7b585900.tar.gz
bigocean: Release reference before returning
Fix a bug where instance references were not being released before returning from IOCTL. bug: 312438904 Change-Id: I55f16e9856aa50e8312b444cb384bebcf7b41174 Signed-off-by: Vinay Kalia <vinaykalia@google.com>
-rw-r--r--bigo.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/bigo.c b/bigo.c
index 9927798..6a35ae3 100644
--- a/bigo.c
+++ b/bigo.c
@@ -394,7 +394,8 @@ static long bigo_unlocked_ioctl(struct file *file, unsigned int cmd,
if (copy_regs_from_user(core, &desc, user_desc, job)) {
pr_err("Failed to copy regs from user\n");
- return -EFAULT;
+ rc = -EFAULT;
+ break;
}
hbd = (((u32*)job->regs)[3]) & BIGO_HBD_BIT;
@@ -406,7 +407,8 @@ static long bigo_unlocked_ioctl(struct file *file, unsigned int cmd,
if(enqueue_prioq(core, inst)) {
pr_err("Failed enqueue frame\n");
- return -EFAULT;
+ rc = -EFAULT;
+ break;
}
ret = wait_for_completion_timeout(
@@ -433,7 +435,8 @@ static long bigo_unlocked_ioctl(struct file *file, unsigned int cmd,
case BIGO_IOCX_MAP:
if (copy_from_user(&mapping, user_desc, sizeof(mapping))) {
pr_err("Failed to copy from user\n");
- return -EFAULT;
+ rc = -EFAULT;
+ break;
}
rc = bigo_map(core, inst, &mapping);
if (rc)
@@ -446,7 +449,8 @@ static long bigo_unlocked_ioctl(struct file *file, unsigned int cmd,
case BIGO_IOCX_UNMAP:
if (copy_from_user(&mapping, user_desc, sizeof(mapping))) {
pr_err("Failed to copy from user\n");
- return -EFAULT;
+ rc = -EFAULT;
+ break;
}
rc = bigo_unmap(inst, &mapping);
if (rc)
@@ -461,7 +465,8 @@ static long bigo_unlocked_ioctl(struct file *file, unsigned int cmd,
case BIGO_IOCX_CONFIG_FRMSIZE:
if (copy_from_user(&frmsize, user_desc, sizeof(frmsize))) {
pr_err("Failed to copy from user\n");
- return -EFAULT;
+ rc = -EFAULT;
+ break;
}
bigo_config_frmsize(inst, &frmsize);
break;