diff options
author | Corey Minyard <cminyard@mvista.com> | 2019-04-24 18:11:16 +0300 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2019-04-24 20:29:24 +0300 |
commit | 44f56a39addecd6e93b8aa6fa51a6255259edbbb (patch) | |
tree | babae5922bd6c63c781149cee8041d585a0e5e1f /drivers/char/ipmi/ipmi_ssif.c | |
parent | 55be8658c7e2feb11a5b5b33ee031791dbd23a69 (diff) | |
download | linux-44f56a39addecd6e93b8aa6fa51a6255259edbbb.tar.xz |
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>
Diffstat (limited to 'drivers/char/ipmi/ipmi_ssif.c')
-rw-r--r-- | drivers/char/ipmi/ipmi_ssif.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index aaccb0ff1ea6..be329f791c95 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -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(); } |