mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] pci: endpoint: Fix double free in pci_epf_create()
@ 2018-02-21 12:47 Rolf Evers-Fischer
  2018-02-21 12:47 ` [PATCH 1/2] pci: endpoint: Free func_name after last usage Rolf Evers-Fischer
  2018-02-21 12:47 ` [PATCH 2/2] pci: endpoint: Fix kernel panic after put_device() Rolf Evers-Fischer
  0 siblings, 2 replies; 12+ messages in thread
From: Rolf Evers-Fischer @ 2018-02-21 12:47 UTC (permalink / raw)
  To: kishon
  Cc: lorenzo.pieralisi, bhelgaas, linux-pci, linux-kernel, Rolf Evers-Fischer

When I accidentally created a new endpoint device with an empty name,
the kernel warned about "attempted to be registered with empty name!"
and crashed afterwards.

It turned out that the crash was not caused by the 'device_add()'
function itself, but by a double kfree of 'epf->name' and 'epf'.

The first patch just simplifies the code, while the second patch
fixes the problem.

Rolf Evers-Fischer (2):
  pci: endpoint: Free func_name after last usage
  pci: endpoint: Fix kernel panic after put_device()

 drivers/pci/endpoint/pci-epf-core.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

-- 
2.16.2

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

end of thread, other threads:[~2018-02-23 20:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-21 12:47 [PATCH 0/2] pci: endpoint: Fix double free in pci_epf_create() Rolf Evers-Fischer
2018-02-21 12:47 ` [PATCH 1/2] pci: endpoint: Free func_name after last usage Rolf Evers-Fischer
2018-02-21 19:00   ` Andy Shevchenko
2018-02-22 16:21     ` Rolf Evers-Fischer
2018-02-22 17:12       ` Andy Shevchenko
2018-02-22 18:19   ` Lorenzo Pieralisi
2018-02-23  6:10     ` Kishon Vijay Abraham I
2018-02-23  9:36       ` Lorenzo Pieralisi
2018-02-23 10:47         ` Kishon Vijay Abraham I
2018-02-23 17:38           ` Rolf Evers-Fischer
2018-02-23 18:30             ` Lorenzo Pieralisi
2018-02-21 12:47 ` [PATCH 2/2] pci: endpoint: Fix kernel panic after put_device() Rolf Evers-Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®