5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arthur Heymans <arthur@xxxxxxxxxxxx> [ Upstream commit c6e7af0515daca800d84b9cfa1bf19e53c4f5bc3 ] Fix a bug where the kernel module couldn't be loaded after unloading, as the platform driver wasn't released on exit. Signed-off-by: Arthur Heymans <arthur@xxxxxxxxxxxx> Signed-off-by: Patrick Rudolph <patrick.rudolph@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20191118101934.22526-3-patrick.rudolph@xxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Stable-dep-of: 32b0901e141f ("firmware: google: Unregister driver_info on failure") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> --- drivers/firmware/google/gsmi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c index 94753ad18ca63..633997af4b09e 100644 --- a/drivers/firmware/google/gsmi.c +++ b/drivers/firmware/google/gsmi.c @@ -1026,6 +1026,9 @@ static __init int gsmi_init(void) dma_pool_destroy(gsmi_dev.dma_pool); platform_device_unregister(gsmi_dev.pdev); pr_info("gsmi: failed to load: %d\n", ret); +#ifdef CONFIG_PM + platform_driver_unregister(&gsmi_driver_info); +#endif return ret; } @@ -1047,6 +1050,9 @@ static void __exit gsmi_exit(void) gsmi_buf_free(gsmi_dev.name_buf); dma_pool_destroy(gsmi_dev.dma_pool); platform_device_unregister(gsmi_dev.pdev); +#ifdef CONFIG_PM + platform_driver_unregister(&gsmi_driver_info); +#endif } module_init(gsmi_init); -- 2.43.0