Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bc9ff09 authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Free smem client after moving core to UNINIT



If userspace crashes prematurely, there will be a good chance that the
driver hasn't unmapped or freed certain buffers.  These buffers will be
freed in the state transition to UNINIT.  At that point the smem client
needs to be valid for the free/unmaps to be valid.

Change-Id: I089dcbd1e79f1c2a8671e5719d3a5dbc9926b252
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent ce42a34f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1373,7 +1373,6 @@ static void cleanup_instance(struct msm_vidc_inst *inst)
			mutex_lock(&inst->lock);
		}
		mutex_unlock(&inst->lock);
		msm_smem_delete_client(inst->mem_client);
		debugfs_remove_recursive(inst->debugfs_root);
		WARN_ON(!list_empty(&inst->pending_getpropq));
	}
@@ -1433,9 +1432,12 @@ int msm_vidc_close(void *instance)
		dprintk(VIDC_ERR,
			"Failed to move video instance to uninit state\n");

	msm_smem_delete_client(inst->mem_client);

	pr_info(VIDC_DBG_TAG "Closed video instance: %p\n",
			VIDC_MSG_PRIO2STRING(VIDC_INFO), inst);
	kfree(inst);

	return 0;
}
EXPORT_SYMBOL(msm_vidc_close);