You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'for-linus-4.18-2' of git://github.com/cminyard/linux-ipmi
Pull IPMI fixes from Corey Minyard: "A couple of small fixes: one to the BMC side of things that fixes an interrupt issue, and one oops fix if init fails in a certain way on the client driver" * tag 'for-linus-4.18-2' of git://github.com/cminyard/linux-ipmi: ipmi: kcs_bmc: fix IRQ exception if the channel is not open ipmi: Cleanup oops on initialization failure
This commit is contained in:
@@ -2088,8 +2088,10 @@ static int try_smi_init(struct smi_info *new_smi)
|
||||
return 0;
|
||||
|
||||
out_err:
|
||||
ipmi_unregister_smi(new_smi->intf);
|
||||
new_smi->intf = NULL;
|
||||
if (new_smi->intf) {
|
||||
ipmi_unregister_smi(new_smi->intf);
|
||||
new_smi->intf = NULL;
|
||||
}
|
||||
|
||||
kfree(init_name);
|
||||
|
||||
|
||||
+11
-22
@@ -210,34 +210,23 @@ static void kcs_bmc_handle_cmd(struct kcs_bmc *kcs_bmc)
|
||||
int kcs_bmc_handle_event(struct kcs_bmc *kcs_bmc)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret = 0;
|
||||
int ret = -ENODATA;
|
||||
u8 status;
|
||||
|
||||
spin_lock_irqsave(&kcs_bmc->lock, flags);
|
||||
|
||||
if (!kcs_bmc->running) {
|
||||
kcs_force_abort(kcs_bmc);
|
||||
ret = -ENODEV;
|
||||
goto out_unlock;
|
||||
status = read_status(kcs_bmc);
|
||||
if (status & KCS_STATUS_IBF) {
|
||||
if (!kcs_bmc->running)
|
||||
kcs_force_abort(kcs_bmc);
|
||||
else if (status & KCS_STATUS_CMD_DAT)
|
||||
kcs_bmc_handle_cmd(kcs_bmc);
|
||||
else
|
||||
kcs_bmc_handle_data(kcs_bmc);
|
||||
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
status = read_status(kcs_bmc) & (KCS_STATUS_IBF | KCS_STATUS_CMD_DAT);
|
||||
|
||||
switch (status) {
|
||||
case KCS_STATUS_IBF | KCS_STATUS_CMD_DAT:
|
||||
kcs_bmc_handle_cmd(kcs_bmc);
|
||||
break;
|
||||
|
||||
case KCS_STATUS_IBF:
|
||||
kcs_bmc_handle_data(kcs_bmc);
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = -ENODATA;
|
||||
break;
|
||||
}
|
||||
|
||||
out_unlock:
|
||||
spin_unlock_irqrestore(&kcs_bmc->lock, flags);
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user