mbox series

[net,0/2] net: sfc: fix memory leak in ->mtd_probe() callback

Message ID 20220510153619.32464-1-ap420073@gmail.com (mailing list archive)
Headers show
Series net: sfc: fix memory leak in ->mtd_probe() callback | expand

Message

Taehee Yoo May 10, 2022, 3:36 p.m. UTC
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(+)