From: Yazen Ghannam Date: Fri, 13 Jan 2017 15:52:19 +0000 (-0600) Subject: EDAC, amd64: Save and return err code from probe_one_instance() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2287c63643f0f52d9d5452b9dc4079aec0889fe8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git EDAC, amd64: Save and return err code from probe_one_instance() We should save the return code from probe_one_instance() so that it can be returned from the module init function. Otherwise, we'll be returning the -ENOMEM from above. Signed-off-by: Yazen Ghannam Cc: linux-edac Link: http://lkml.kernel.org/r/1484322741-41884-1-git-send-email-Yazen.Ghannam@amd.com Signed-off-by: Borislav Petkov --- diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 260251177830..4a480da713b9 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -3466,14 +3466,16 @@ static int __init amd64_edac_init(void) if (!msrs) goto err_free; - for (i = 0; i < amd_nb_num(); i++) - if (probe_one_instance(i)) { + for (i = 0; i < amd_nb_num(); i++) { + err = probe_one_instance(i); + if (err) { /* unwind properly */ while (--i >= 0) remove_one_instance(i); goto err_pci; } + } setup_pci_device();