mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
Merge "memshare: Free QMI handle only if its valid"
This commit is contained in:
commit
c3cdfb23f5
1 changed files with 12 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/err.h>
|
||||
|
|
@ -779,6 +780,7 @@ static void memshare_init_worker(struct work_struct *work)
|
|||
dev_err(memsh_drv->dev,
|
||||
"memshare: Creating mem_share_svc qmi handle failed\n");
|
||||
kfree(mem_share_svc_handle);
|
||||
mem_share_svc_handle = NULL;
|
||||
destroy_workqueue(mem_share_svc_workqueue);
|
||||
return;
|
||||
}
|
||||
|
|
@ -787,8 +789,11 @@ static void memshare_init_worker(struct work_struct *work)
|
|||
if (rc < 0) {
|
||||
dev_err(memsh_drv->dev,
|
||||
"memshare: Registering mem share svc failed %d\n", rc);
|
||||
qmi_handle_release(mem_share_svc_handle);
|
||||
kfree(mem_share_svc_handle);
|
||||
if (mem_share_svc_handle) {
|
||||
qmi_handle_release(mem_share_svc_handle);
|
||||
kfree(mem_share_svc_handle);
|
||||
mem_share_svc_handle = NULL;
|
||||
}
|
||||
destroy_workqueue(mem_share_svc_workqueue);
|
||||
return;
|
||||
}
|
||||
|
|
@ -971,8 +976,11 @@ static int memshare_remove(struct platform_device *pdev)
|
|||
return 0;
|
||||
|
||||
flush_workqueue(mem_share_svc_workqueue);
|
||||
qmi_handle_release(mem_share_svc_handle);
|
||||
kfree(mem_share_svc_handle);
|
||||
if (mem_share_svc_handle) {
|
||||
qmi_handle_release(mem_share_svc_handle);
|
||||
kfree(mem_share_svc_handle);
|
||||
mem_share_svc_handle = NULL;
|
||||
}
|
||||
destroy_workqueue(mem_share_svc_workqueue);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue