netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: sfc: fix memory leak in ->mtd_probe() callback
@ 2022-05-10 15:36 Taehee Yoo
  2022-05-10 15:36 ` [PATCH net 1/2] net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe() Taehee Yoo
  2022-05-10 15:36 ` [PATCH net 2/2] net: sfc: siena: fix memory leak in siena_mtd_probe() Taehee Yoo
  0 siblings, 2 replies; 6+ messages in thread
From: Taehee Yoo @ 2022-05-10 15:36 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, ecree.xilinx, habetsm.xilinx, netdev
  Cc: ap420073

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(+)

-- 
2.17.1


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

end of thread, other threads:[~2022-05-11  8:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 15:36 [PATCH net 0/2] net: sfc: fix memory leak in ->mtd_probe() callback Taehee Yoo
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

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).