Commit ea9561cf authored by Linus Torvalds's avatar Linus Torvalds

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
parents 43b6b6ec dc0f0a02
...@@ -2088,8 +2088,10 @@ static int try_smi_init(struct smi_info *new_smi) ...@@ -2088,8 +2088,10 @@ static int try_smi_init(struct smi_info *new_smi)
return 0; return 0;
out_err: out_err:
ipmi_unregister_smi(new_smi->intf); if (new_smi->intf) {
new_smi->intf = NULL; ipmi_unregister_smi(new_smi->intf);
new_smi->intf = NULL;
}
kfree(init_name); kfree(init_name);
......
...@@ -210,34 +210,23 @@ static void kcs_bmc_handle_cmd(struct kcs_bmc *kcs_bmc) ...@@ -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) int kcs_bmc_handle_event(struct kcs_bmc *kcs_bmc)
{ {
unsigned long flags; unsigned long flags;
int ret = 0; int ret = -ENODATA;
u8 status; u8 status;
spin_lock_irqsave(&kcs_bmc->lock, flags); spin_lock_irqsave(&kcs_bmc->lock, flags);
if (!kcs_bmc->running) { status = read_status(kcs_bmc);
kcs_force_abort(kcs_bmc); if (status & KCS_STATUS_IBF) {
ret = -ENODEV; if (!kcs_bmc->running)
goto out_unlock; kcs_force_abort(kcs_bmc);
} else if (status & KCS_STATUS_CMD_DAT)
kcs_bmc_handle_cmd(kcs_bmc);
status = read_status(kcs_bmc) & (KCS_STATUS_IBF | KCS_STATUS_CMD_DAT); else
kcs_bmc_handle_data(kcs_bmc);
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 = 0;
ret = -ENODATA;
break;
} }
out_unlock:
spin_unlock_irqrestore(&kcs_bmc->lock, flags); spin_unlock_irqrestore(&kcs_bmc->lock, flags);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment