mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
qseecom: Fix kernel panic
There exist a possibility for "handle" input being NULL. We need to check for this before dereferencing it. Change-Id: I50c1c6855ad303e05b52e6e37d774551d9db4fc4 Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
This commit is contained in:
parent
aa0368ee4f
commit
3c7a360edf
1 changed files with 4 additions and 4 deletions
|
@ -1524,8 +1524,8 @@ EXPORT_SYMBOL(qseecom_start_app);
|
|||
int qseecom_shutdown_app(struct qseecom_handle **handle)
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
struct qseecom_dev_handle *data =
|
||||
(struct qseecom_dev_handle *) ((*handle)->dev);
|
||||
struct qseecom_dev_handle *data;
|
||||
|
||||
struct qseecom_registered_kclient_list *kclient = NULL;
|
||||
unsigned long flags = 0;
|
||||
bool found_handle = false;
|
||||
|
@ -1534,11 +1534,11 @@ int qseecom_shutdown_app(struct qseecom_handle **handle)
|
|||
pr_err("This functionality is UNSUPPORTED in version 1.3\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (*handle == NULL) {
|
||||
if ((handle == NULL) || (*handle == NULL)) {
|
||||
pr_err("Handle is not initialized\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
data = (struct qseecom_dev_handle *) ((*handle)->dev);
|
||||
spin_lock_irqsave(&qseecom.registered_kclient_list_lock, flags);
|
||||
list_for_each_entry(kclient, &qseecom.registered_kclient_list_head,
|
||||
list) {
|
||||
|
|
Loading…
Reference in a new issue