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

Commit 8714e647 authored by Tharun Kumar Merugu's avatar Tharun Kumar Merugu
Browse files

msm: adsprpc: destroy mutex before file free



Destroy mutex before file free, to avoid use after free of mutex.

Change-Id: I4ff73dc17b15043eacbb299219a379bfd1a8efa6
Acked-by: default avatarHimateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent b2f7549d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2764,6 +2764,7 @@ static int fastrpc_file_free(struct fastrpc_file *fl)
	mutex_unlock(&fl->perf_mutex);
	mutex_destroy(&fl->perf_mutex);
	mutex_destroy(&fl->fl_map_mutex);
	mutex_destroy(&fl->map_mutex);
	kfree(fl);
	return 0;
}
@@ -2777,7 +2778,6 @@ static int fastrpc_device_release(struct inode *inode, struct file *file)
			pm_qos_remove_request(&fl->pm_qos_req);
		if (fl->debugfs_file != NULL)
			debugfs_remove(fl->debugfs_file);
		mutex_destroy(&fl->map_mutex);
		fastrpc_file_free(fl);
		file->private_data = NULL;
	}