• Kefeng Wang's avatar
    ipmi_ssif: fix unexpected driver unregister warning · 2cd0e544
    Kefeng Wang authored
    If platform_driver_register() fails from init_ipmi_ssif(),
    platform_driver_unregister() called unconditionally will
    trigger following warning,
    
    ipmi_ssif: Unable to register driver: -12
    ------------[ cut here ]------------
    Unexpected driver unregister!
    WARNING: CPU: 1 PID: 6305 at drivers/base/driver.c:193 driver_unregister+0x60/0x70 drivers/base/driver.c:193
    
    Fix it by adding platform_registered variable, only unregister platform
    driver when it is already successfully registered.
    Reported-by: default avatarHulk Robot <hulkci@huawei.com>
    Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
    Message-Id: <20190524143724.43218-1-wangkefeng.wang@huawei.com>
    Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
    2cd0e544
ipmi_ssif.c 53.8 KB