aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index f04bee76ba2b..c02f5177a816 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -684,22 +684,24 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
684 { 684 {
685 /* We are idle and the upper layer requested that I fetch 685 /* We are idle and the upper layer requested that I fetch
686 events, so do so. */ 686 events, so do so. */
687 unsigned char msg[2]; 687 atomic_set(&smi_info->req_events, 0);
688 688
689 spin_lock(&smi_info->count_lock); 689 smi_info->curr_msg = ipmi_alloc_smi_msg();
690 smi_info->flag_fetches++; 690 if (!smi_info->curr_msg)
691 spin_unlock(&smi_info->count_lock); 691 goto out;
692 692
693 atomic_set(&smi_info->req_events, 0); 693 smi_info->curr_msg->data[0] = (IPMI_NETFN_APP_REQUEST << 2);
694 msg[0] = (IPMI_NETFN_APP_REQUEST << 2); 694 smi_info->curr_msg->data[1] = IPMI_READ_EVENT_MSG_BUFFER_CMD;
695 msg[1] = IPMI_GET_MSG_FLAGS_CMD; 695 smi_info->curr_msg->data_size = 2;
696 696
697 smi_info->handlers->start_transaction( 697 smi_info->handlers->start_transaction(
698 smi_info->si_sm, msg, 2); 698 smi_info->si_sm,
699 smi_info->si_state = SI_GETTING_FLAGS; 699 smi_info->curr_msg->data,
700 smi_info->curr_msg->data_size);
701 smi_info->si_state = SI_GETTING_EVENTS;
700 goto restart; 702 goto restart;
701 } 703 }
702 704 out:
703 return si_sm_result; 705 return si_sm_result;
704} 706}
705 707