msm: lmh_lite: Pass proper size for dma memory free API call

Use proper size for dma memory free call API while saving lmh sensors
list in lmh hardware driver otherwise it leads to memory leak or
unexpected crash if scm_call error path is executed.

CRs-Fixed: 982320
Change-Id: I31ac79585c8899b44ece745676d9af79fe8bca78
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
This commit is contained in:
Manaf Meethalavalappu Pallikunhi 2016-02-26 18:12:15 +05:30 committed by Gerrit - the friendly Code Review server
parent 186fb6e30c
commit a981431516
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -630,7 +630,8 @@ static int lmh_get_sensor_list(void)
} while (next < size);
get_exit:
dma_free_attrs(&dev, size, payload, payload_phys, &attrs);
dma_free_attrs(&dev, PAGE_ALIGN(sizeof(struct lmh_sensor_packet)),
payload, payload_phys, &attrs);
return ret;
}