Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bus: mhi: pci-generic: Add missing 'pci_disable_pcie_error_reporting()' calls

If an error occurs after a 'pci_enable_pcie_error_reporting()' call, it
must be undone by a corresponding 'pci_disable_pcie_error_reporting()'
call

Add the missing call in the error handling path of the probe and in the
remove function.

Cc: <stable@vger.kernel.org>
Fixes: b012ee6bfe2a ("mhi: pci_generic: Add PCI error handlers")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/f70c14701f4922d67e717633c91b6c481b59f298.1623445348.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20210621161616.77524-6-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Christophe JAILLET and committed by
Greg Kroah-Hartman
a25d144f 02b49cd1

+4 -1
+4 -1
drivers/bus/mhi/pci_generic.c
··· 665 665 666 666 err = mhi_register_controller(mhi_cntrl, mhi_cntrl_config); 667 667 if (err) 668 - return err; 668 + goto err_disable_reporting; 669 669 670 670 /* MHI bus does not power up the controller by default */ 671 671 err = mhi_prepare_for_power_up(mhi_cntrl); ··· 699 699 mhi_unprepare_after_power_down(mhi_cntrl); 700 700 err_unregister: 701 701 mhi_unregister_controller(mhi_cntrl); 702 + err_disable_reporting: 703 + pci_disable_pcie_error_reporting(pdev); 702 704 703 705 return err; 704 706 } ··· 723 721 pm_runtime_get_noresume(&pdev->dev); 724 722 725 723 mhi_unregister_controller(mhi_cntrl); 724 + pci_disable_pcie_error_reporting(pdev); 726 725 } 727 726 728 727 static void mhi_pci_shutdown(struct pci_dev *pdev)