Skip to content

Fix two memory leaks in rproc_attach()

Xiaolei Wang imx linux-arm-kernel linux-remoteproc lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 2 repliesIn review
  2. v22 patches 10 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Changes in v3 from the cover letter

Update patch1, replace the "unprepare_device" goto statement with "clean_up_resources" and get rid of the "unprepare_device" label.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2remoteproc: cleanup acquired resources when rproc_handle_resources() fails in rproc_attach()drivers/remoteproc/remoteproc_core.c+2 -30 replies
2/2remoteproc: core: release rproc->clean_table after rproc_attach() failsdrivers/remoteproc/remoteproc_core.c+1 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPeng Fan
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] Fix two memory leaks in rproc_attach()

In the rproc_attach() function, if rproc_handle_resources() returns failure, the resources requested in imx_rproc_prepare() should be released, since almost the same thing is done in imx_rproc_prepare() and rproc_resource_cleanup(), Function rproc_resource_cleanup() is able to deal with empty lists so it is better to fix the "goto" statements in rproc_attach(). replace the "unprepare_device" goto statement with "clean_up_resources" and get rid of the "unprepare_device" label. and rproc->clean_table should also be released

Changes in v3:
Update patch1, replace the "unprepare_device" goto statement with "clean_up_resources" and get rid of the "unprepare_device" label.

V2:

    Updated the commit log of these two patches
    https://patchwork.kernel.org/project/linux-remoteproc/patch/[email protected]/
    https://patchwork.kernel.org/project/linux-remoteproc/patch/[email protected]/

V1: https://patchwork.kernel.org/project/linux-remoteproc/patch/[email protected]/

    https://patchwork.kernel.org/project/linux-remoteproc/patch/[email protected]/

Xiaolei Wang (2):
remoteproc: cleanup acquired resources when rproc_handle_resources()
fails in rproc_attach()
remoteproc: core: release rproc->clean_table after rproc_attach()
fails

 drivers/remoteproc/remoteproc_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1