Jiri Slaby <jslaby@xxxxxxx> writes: > >> @@ -2734,18 +2724,21 @@ static int nvme_dev_map(struct nvme_dev *dev) >> >> return 0; >> >> - unmap: >> - iounmap(dev->bar); >> - dev->bar = NULL; >> disable: >> pci_release_regions(pdev); >> - disable_pci: >> - pci_disable_device(pdev); > > Is this a correct backport? > > The original removes pci_release_regions, not pci_disable_device. > Hi Jiri, Oh, you are correct. We need pci_disable_device here to reverse pci_enable_device_mem on error, while should go pci_release_regions into nvme_dev_map to reverse the pci_request_selected_regions call. Unfortunately, my test case never touched this error path. Greg, would you take the fix below into the -stable tree? -- >8 -- Subject: [PATCH] nvme: Call pci_disable_device on the error path. Commit 5706aca74fe4 ("NVMe: Don't unmap controller registers on reset"), which backported b00a726a9fd8 to the 4.4.y kernel introduced a regression in which it didn't call pci_disable_device in the error path of nvme_pci_enable. Reported-by: Jiri Slaby <jslaby@xxxxxxx> Embarassed-developer: Gabriel Krisman Bertazi <krisman@xxxxxxxxxxxxxxxxxx> Signed-off-by: Gabriel Krisman Bertazi <krisman@xxxxxxxxxxxxxxxxxx> --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 289a5df0d44a..c851bc53831c 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2725,7 +2725,7 @@ static int nvme_pci_enable(struct nvme_dev *dev) return 0; disable: - pci_release_regions(pdev); + pci_disable_device(pdev); return result; } -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html