mbox series

[v5,0/2] ipc: fix possible memory leaks

Message ID 20190503102857.15812-1-herakliusz.lipiec@intel.com (mailing list archive)
Headers
Series ipc: fix possible memory leaks |

Message

Herakliusz Lipiec May 3, 2019, 10:28 a.m. UTC
  When sending multiple requests, rte_mp_request_sync
can succeed sending a few of those requests, but then
fail on a later one and in the end return with rc=-1.
The upper layers - e.g. device hotplug - currently
handles this case as if no messages were sent and no
memory for response buffers was allocated, which is
not true. Fixed by always initializing message buffer
to NULL and calling free everytime rte_mp_request_sync
is used.

v5:
- change prefixes in commit titles.

v4:
- fixed checkpatch issues

v3:
- rework of the patchset
- caller is no longer responsible for freeing buffers on failure
- caller still has to free response buffers on success
- patchset reduced from 8 patches to 2

v2:
- resending as patchset to make it easier to review it.
- changed commit message as requested.
- added bugzilla id.

Bugzilla ID: 228
Herakliusz Lipiec (2):
  ipc: fix memory leak in sync request
  net/tap: fix ipc related memory leak

 drivers/net/tap/rte_eth_tap.c           |  2 +-
 lib/librte_eal/common/eal_common_proc.c | 22 +++++++++++++++-------
 2 files changed, 16 insertions(+), 8 deletions(-)
  

Comments

Thomas Monjalon May 3, 2019, 10:54 a.m. UTC | #1
03/05/2019 12:28, Herakliusz Lipiec:
> When sending multiple requests, rte_mp_request_sync
> can succeed sending a few of those requests, but then
> fail on a later one and in the end return with rc=-1.
> The upper layers - e.g. device hotplug - currently
> handles this case as if no messages were sent and no
> memory for response buffers was allocated, which is
> not true. Fixed by always initializing message buffer
> to NULL and calling free everytime rte_mp_request_sync
> is used.
> 
> v5:
> - change prefixes in commit titles.

I already applied v4 with fixed titles, thanks