public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andrea Claudi <aclaudi@redhat•com>
To: netdev@vger•kernel.org
Cc: stephen@networkplumber•org, dsahern@gmail•com,
	markzhang@nvidia•com, leonro@nvidia•com
Subject: [PATCH iproute2 v2 0/2] fix memory leak in get_task_name()
Date: Wed,  2 Mar 2022 13:28:46 +0100	[thread overview]
Message-ID: <cover.1646223467.git.aclaudi@redhat.com> (raw)

This series fixes some memory leaks related to the usage of the
get_task_name() function from lib/fs.c.

Patch 2/2 addresses a coverity warning related to this memory leak,
making the code a bit more readable by humans and coverity.

Changelog:
----------
v1 -> v2
- on Stephen's suggestion, drop asprintf() and use a local var for path;
  additionally drop %m from fscanf to not allocate memory, and resort to
  a param to return task name to the caller.
- patch 2/3 of the original series is no more needed.

Andrea Claudi (2):
  lib/fs: fix memory leak in get_task_name()
  rdma: make RES_PID and RES_KERN_NAME alternative to each other

 include/utils.h |  2 +-
 ip/iptuntap.c   | 17 ++++++++++-------
 lib/fs.c        | 20 ++++++++++----------
 rdma/res-cmid.c | 18 +++++++++---------
 rdma/res-cq.c   | 17 +++++++++--------
 rdma/res-ctx.c  | 16 ++++++++--------
 rdma/res-mr.c   | 15 ++++++++-------
 rdma/res-pd.c   | 17 +++++++++--------
 rdma/res-qp.c   | 16 ++++++++--------
 rdma/res-srq.c  | 17 +++++++++--------
 rdma/stat.c     | 14 +++++++++-----
 11 files changed, 90 insertions(+), 79 deletions(-)

-- 
2.35.1


             reply	other threads:[~2022-03-02 12:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02 12:28 Andrea Claudi [this message]
2022-03-02 12:28 ` [PATCH iproute2 v2 1/2] lib/fs: fix memory leak in get_task_name() Andrea Claudi
2022-03-03 18:56   ` Leon Romanovsky
2022-03-07 18:07     ` Andrea Claudi
2022-03-07 18:12       ` David Ahern
2022-03-09 13:39       ` Leon Romanovsky
2022-03-07 17:58   ` David Ahern
2022-03-07 18:14     ` Stephen Hemminger
2022-03-07 18:21     ` Andrea Claudi
2022-03-07 19:57       ` Stephen Hemminger
2022-03-07 22:38       ` David Ahern
2022-03-02 12:28 ` [PATCH iproute2 v2 2/2] rdma: make RES_PID and RES_KERN_NAME alternative to each other Andrea Claudi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1646223467.git.aclaudi@redhat.com \
    --to=aclaudi@redhat$(echo .)com \
    --cc=dsahern@gmail$(echo .)com \
    --cc=leonro@nvidia$(echo .)com \
    --cc=markzhang@nvidia$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=stephen@networkplumber$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox