netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 v3 0/2] fix memory leak in get_task_name()
@ 2022-03-08 17:04 Andrea Claudi
  2022-03-08 17:04 ` [PATCH iproute2 v3 1/2] lib/fs: " Andrea Claudi
  2022-03-08 17:04 ` [PATCH iproute2 v3 2/2] rdma: make RES_PID and RES_KERN_NAME alternative to each other Andrea Claudi
  0 siblings, 2 replies; 4+ messages in thread
From: Andrea Claudi @ 2022-03-08 17:04 UTC (permalink / raw)
  To: netdev; +Cc: stephen, dsahern, markzhang, leonro

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:
----------
v2 -> v3
- Use a better API for get_task_name(), passing to it a buffer and its
  lenght just like get_command_name().

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        | 23 +++++++++++++----------
 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, 93 insertions(+), 79 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-08 17:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-08 17:04 [PATCH iproute2 v3 0/2] fix memory leak in get_task_name() Andrea Claudi
2022-03-08 17:04 ` [PATCH iproute2 v3 1/2] lib/fs: " Andrea Claudi
2022-03-08 17:30   ` Stephen Hemminger
2022-03-08 17:04 ` [PATCH iproute2 v3 2/2] rdma: make RES_PID and RES_KERN_NAME alternative to each other Andrea Claudi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).