soc: qcom: pil: Fix memory management when loading firmware segs
When loading the firmware segments for a peripheral image,
a bitmap is used to track which segments could not be loaded
successfully. However, the current code allocates num_segs
number of unsigned longs, instead of allocating the number
of unsigned longs needed such that each seg is represented
as a bit. Also, the current code does not free the error
tracking bitmap after it is finished using it, or if the
segment data structures cannot be allocated.
During firmware segment loading, allocate enough unsigned
longs to represent each segment as a bit, and also free
the error tracking bitmap when it is no longer needed, and
when the segment loading data structures cannot be allocated.
Change-Id: Ica6aa6d82387ffbb9e0702093eef26a09aefed4a
Signed-off-by:
Isaac J. Manjarres <isaacm@codeaurora.org>
Loading
Please register or sign in to comment