diff options
author | Vinay Kalia <vinaykalia@google.com> | 2024-01-05 23:14:18 +0000 |
---|---|---|
committer | Vinay Kalia <vinaykalia@google.com> | 2024-01-17 22:47:40 +0000 |
commit | 4dd0c190d0b215a8aaa809db017e55c4df380f63 (patch) | |
tree | d87851afd8af8982eb25f36c1e4e7a19eaca7eb4 | |
parent | de262b4989e29797b7c94851fbe918ee8dc5f93f (diff) | |
download | gchips-android-14.0.0_r0.67.tar.gz |
bigwave: Release reference before returningandroid-14.0.0_r0.77android-14.0.0_r0.67android-14.0.0_r0.57android-gs-shusky-5.15-android14-qpr2
Fix a bug where instance references were not being released before
returning from IOCTL.
bug: 312438904
Change-Id: I1465dfa0f87533ae488fb9614d0f88e22cad1572
(cherry picked from commit 2239da078dfa57c3c454ea42213c807a5e3a2670)
Signed-off-by: Vinay Kalia <vinaykalia@google.com>
-rw-r--r-- | bigo.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -414,7 +414,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; @@ -428,7 +429,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( @@ -455,7 +457,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) @@ -468,7 +471,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) @@ -478,7 +482,8 @@ static long bigo_unlocked_ioctl(struct file *file, unsigned int cmd, struct bigo_buf_sync sync; if (copy_from_user(&sync, user_desc, sizeof(sync))) { pr_err("Failed to copy from user\n"); - return -EFAULT; + rc = -EFAULT; + break; } rc = bigo_dma_sync(&sync); if (rc) @@ -494,7 +499,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; @@ -519,7 +525,8 @@ static long bigo_unlocked_ioctl(struct file *file, unsigned int cmd, struct bigo_ioc_misc misc; if (copy_from_user(&misc, user_desc, sizeof(misc))) { pr_err("Failed to copy from user\n"); - return -EFAULT; + rc = -EFAULT; + break; } switch (misc.cmd) { case BIGO_GET_PADDING_SIZE: { |