Skip to content

Commit 651015c

Browse files
ij-intelgregkh
authored andcommitted
hwrng: amd - Convert PCIBIOS_* return codes to errnos
commit 14cba6a upstream. amd_rng_mod_init() uses pci_read_config_dword() that returns PCIBIOS_* codes. The return code is then returned as is but amd_rng_mod_init() is a module_init() function that should return normal errnos. Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal errno before returning it. Fixes: 96d63c0 ("[PATCH] Add AMD HW RNG driver") Cc: stable@vger.kernel.org Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6349978 commit 651015c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/char/hw_random/amd-rng.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ static int __init amd_rng_mod_init(void)
142142

143143
found:
144144
err = pci_read_config_dword(pdev, 0x58, &pmbase);
145-
if (err)
145+
if (err) {
146+
err = pcibios_err_to_errno(err);
146147
goto put_dev;
148+
}
147149

148150
pmbase &= 0x0000FF00;
149151
if (pmbase == 0) {

0 commit comments

Comments
 (0)