Remove unnecessary bus_ops = NULL assignment in pci_bus_set_aer_ops to prevent a memory leak when ops are equal to &aer_inj_pci_ops. This change ensures allocated bus_ops memory is properly freed. Signed-off-by: Zijie Zhao <zzjas98@xxxxxxxxx> --- drivers/pci/pcie/aer_inject.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/pci/pcie/aer_inject.c b/drivers/pci/pcie/aer_inject.c index 2dab275d252f..0c84fadbfd2e 100644 --- a/drivers/pci/pcie/aer_inject.c +++ b/drivers/pci/pcie/aer_inject.c @@ -309,7 +309,6 @@ static int pci_bus_set_aer_ops(struct pci_bus *bus) goto out; pci_bus_ops_init(bus_ops, bus, ops); list_add(&bus_ops->list, &pci_bus_ops_list); - bus_ops = NULL; out: spin_unlock_irqrestore(&inject_lock, flags); kfree(bus_ops); -- 2.34.1