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

Commit a5124134 authored by Tharun Kumar Merugu's avatar Tharun Kumar Merugu Committed by Gerrit - the friendly Code Review server
Browse files

msm: ADSPRPC: Null check for file session context during device release



While releasing the device, check if the file session context is
NULL to make sure we are not dereferencing during file free.

Change-Id: I4ba08cf9a1d56a5e28e6230b9f2fe02a52b70cb0
Acked-by: default avatarVishnu Karthik D <vikarthi@qti.qualcomm.com>
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent 827c6ada
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1735,6 +1735,11 @@ static int fastrpc_file_free(struct fastrpc_file *fl)
	hlist_del_init(&fl->hn);
	spin_unlock(&fl->apps->hlock);

	if (!fl->sctx) {
		kfree(fl);
		return 0;
	}

	(void)fastrpc_release_current_dsp_process(fl);
	fastrpc_context_list_dtor(fl);
	fastrpc_buf_list_free(fl);