Skip to content

Commit

Permalink
eal: fix leak on device event callback unregister
Browse files Browse the repository at this point in the history
[ upstream commit c78bd27 ]

The event_cb->dev_name is not freed when freeing event_cb,
and this causes a memory leak.

Fixes: a753e53 ("eal: add device event monitor framework")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
wyjwang authored and bluca committed Nov 5, 2020
1 parent 3109cc6 commit 6461d31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/librte_eal/common/eal_common_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ rte_dev_event_callback_unregister(const char *device_name,
*/
if (event_cb->active == 0) {
TAILQ_REMOVE(&dev_event_cbs, event_cb, next);
free(event_cb->dev_name);
free(event_cb);
ret++;
} else {
Expand Down

0 comments on commit 6461d31

Please sign in to comment.