archive mirror
 help / color / mirror / Atom feed
From: Taehee Yoo <>
Subject: [PATCH net 0/2] net: sfc: fix memory leak in ->mtd_probe() callback
Date: Tue, 10 May 2022 15:36:17 +0000	[thread overview]
Message-ID: <> (raw)

This patchset fixes memory leak in ->mtd_probe() callback.

The goal of ->mtd_probe() callback is to allocate and initialize
mtd partition and this is global data of sfc driver.

If NIC has 2 ports, ->mtd_probe() callback will be called twice.
So it allocates mtd partition twice and last allocated mtd partition data
will not be used.
So it should be freed, but it doesn't.

This patchset contains patches for ef10 and siena device.
But I tested only ef10(X2522-25G).
Siena version of ->mtd_probe() callback is similar to ef10 version.
So I added it.
But falcon version of ->mtd_probe() code looks different.
So I didn't add.

Taehee Yoo (2):
  net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe()
  net: sfc: siena: fix memory leak in siena_mtd_probe()

 drivers/net/ethernet/sfc/ef10.c  | 5 +++++
 drivers/net/ethernet/sfc/siena.c | 5 +++++
 2 files changed, 10 insertions(+)


             reply	other threads:[~2022-05-10 15:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 15:36 Taehee Yoo [this message]
2022-05-10 15:36 ` [PATCH net 1/2] net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe() Taehee Yoo
2022-05-11  6:09   ` Martin Habets
2022-05-10 15:36 ` [PATCH net 2/2] net: sfc: siena: fix memory leak in siena_mtd_probe() Taehee Yoo
2022-05-11  6:25   ` Martin Habets
2022-05-11  8:14     ` Taehee Yoo

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).