remoteproc: qcom: Fix error handling paths in order to avoid memory leaks
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 15 Nov 2017 06:58:35 +0000 (07:58 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Wed, 15 Nov 2017 07:20:11 +0000 (23:20 -0800)
commit1a5d5c592e902191bfa091ec9169aa43299a7d0f
tree3c93a23af068752e0441af9abd36de6bb5618128
parent9f2a4342a8bf24c644204311f0cf154f78489b53
remoteproc: qcom: Fix error handling paths in order to avoid memory leaks

In case of error returned by 'q6v5_xfer_mem_ownership', we must free
some resources before returning.

In 'q6v5_mpss_init_image()', add a new label to undo a previous
'dma_alloc_attrs()'.
In 'q6v5_mpss_load()', re-use the already existing error handling code to
undo a previous 'request_firmware()', as already done in the other error
handling paths of the function.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/qcom_q6v5_pil.c