ipmi:ssif: Only unregister the platform driver if it was registered

Otherwise you will get an error when the driver is removed if you
set trydmi=0.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
This commit is contained in:
Corey Minyard 2019-04-24 10:11:16 -05:00
parent 55be8658c7
commit 44f56a39ad
1 changed files with 2 additions and 1 deletions

View File

@ -2111,7 +2111,8 @@ static void cleanup_ipmi_ssif(void)
kfree(ssif_i2c_driver.address_list);
platform_driver_unregister(&ipmi_driver);
if (ssif_trydmi)
platform_driver_unregister(&ipmi_driver);
free_ssif_clients();
}