diff options
| author | Sreelakshmi Gownipalli <sgownipa@codeaurora.org> | 2016-10-19 17:08:23 -0700 |
|---|---|---|
| committer | Sreelakshmi Gownipalli <sgownipa@codeaurora.org> | 2016-11-14 10:47:51 -0800 |
| commit | 2d6dc48e83fd57c825d9f7d9d95bf9610d9e7a19 (patch) | |
| tree | b8fe40a26f801ee43e4bdbcca78f9a07bee3433c /drivers/char/diag/diagfwd_mhi.c | |
| parent | 85d7e134cc5d95dfd3a1a5ee5a1d1435633288cd (diff) | |
diag: Call diagmem_exit only if the mempool is initialized
Call diagmem_exit in diag_mhi_exit only if the memory pool is
initialized earlier. If diag bridge initialization fails
allow diag apps to still communicate to other processors
without unloading the diag driver.
Change-Id: I0eb8b9a357f172984612175d1b03dd872df91b6f
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Diffstat (limited to 'drivers/char/diag/diagfwd_mhi.c')
| -rw-r--r-- | drivers/char/diag/diagfwd_mhi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/char/diag/diagfwd_mhi.c b/drivers/char/diag/diagfwd_mhi.c index f7b1e98f22b0..df26e2522baf 100644 --- a/drivers/char/diag/diagfwd_mhi.c +++ b/drivers/char/diag/diagfwd_mhi.c @@ -49,6 +49,7 @@ struct diag_mhi_info diag_mhi[NUM_MHI_DEV] = { .enabled = 0, .num_read = 0, .mempool = POOL_TYPE_MDM, + .mempool_init = 0, .mhi_wq = NULL, .read_ch = { .chan = MHI_CLIENT_DIAG_IN, @@ -68,6 +69,7 @@ struct diag_mhi_info diag_mhi[NUM_MHI_DEV] = { .enabled = 0, .num_read = 0, .mempool = POOL_TYPE_MDM_DCI, + .mempool_init = 0, .mhi_wq = NULL, .read_ch = { .chan = MHI_CLIENT_DCI_IN, @@ -684,6 +686,7 @@ int diag_mhi_init() strlcpy(wq_name, "diag_mhi_", DIAG_MHI_STRING_SZ); strlcat(wq_name, mhi_info->name, sizeof(mhi_info->name)); diagmem_init(driver, mhi_info->mempool); + mhi_info->mempool_init = 1; mhi_info->mhi_wq = create_singlethread_workqueue(wq_name); if (!mhi_info->mhi_wq) goto fail; @@ -725,7 +728,8 @@ void diag_mhi_exit() if (mhi_info->mhi_wq) destroy_workqueue(mhi_info->mhi_wq); mhi_close(mhi_info->id); - diagmem_exit(driver, mhi_info->mempool); + if (mhi_info->mempool_init) + diagmem_exit(driver, mhi_info->mempool); } } |
