diff options
author | Sreelakshmi Gownipalli <sgownipa@codeaurora.org> | 2017-09-18 12:41:47 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-12-05 23:36:47 -0800 |
commit | aed8e81ec69fcff6a35841b724a18ca004beedce (patch) | |
tree | 2eb58bb629b12463fdf283af27a53c0f544bc79c /drivers/char | |
parent | 4f8f0737764aefd860f16eca0af844a639f8a11b (diff) |
diag: Free the memory in diagfwd_peripheral_exit()
In diagfwd_peripheral_exit() free the memory associated with
early_init_info.
Change-Id: I862b6d806d67dad38316f1608827a4bf6f5a691f
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/diag/diagfwd_peripheral.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/char/diag/diagfwd_peripheral.c b/drivers/char/diag/diagfwd_peripheral.c index b7dff47623de..7e428ce972a8 100644 --- a/drivers/char/diag/diagfwd_peripheral.c +++ b/drivers/char/diag/diagfwd_peripheral.c @@ -911,6 +911,7 @@ void diagfwd_peripheral_exit(void) uint8_t peripheral; uint8_t type; struct diagfwd_info *fwd_info = NULL; + int transport = 0; diag_smd_exit(); diag_socket_exit(); @@ -933,7 +934,10 @@ void diagfwd_peripheral_exit(void) driver->diagfwd_dci_cmd[peripheral] = NULL; } - kfree(early_init_info); + for (transport = 0; transport < NUM_TRANSPORT; transport++) { + kfree(early_init_info[transport]); + early_init_info[transport] = NULL; + } } int diagfwd_cntl_register(uint8_t transport, uint8_t peripheral, void *ctxt, |