Skip to content

Commit 3118d7a

Browse files
committed
Merge tag 'for-linus-5.17-2' of https://github.com/cminyard/linux-ipmi
Pull IPMI fixes from Corey Minyard: "Fix some issues that were reported. This has been in for-next for a bit (longer than the times would indicate, I had to rebase to add some text to the headers) and these are fixes that need to go in" * tag 'for-linus-5.17-2' of https://github.com/cminyard/linux-ipmi: ipmi:ipmi_ipmb: Fix null-ptr-deref in ipmi_unregister_smi() ipmi: When handling send message responses, don't process the message
2 parents 107c948 + 9cc3aac commit 3118d7a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3677,8 +3677,11 @@ static void cleanup_smi_msgs(struct ipmi_smi *intf)
36773677
void ipmi_unregister_smi(struct ipmi_smi *intf)
36783678
{
36793679
struct ipmi_smi_watcher *w;
3680-
int intf_num = intf->intf_num, index;
3680+
int intf_num, index;
36813681

3682+
if (!intf)
3683+
return;
3684+
intf_num = intf->intf_num;
36823685
mutex_lock(&ipmi_interfaces_mutex);
36833686
intf->intf_num = -1;
36843687
intf->in_shutdown = true;
@@ -4518,6 +4521,8 @@ static int handle_one_recv_msg(struct ipmi_smi *intf,
45184521
} else
45194522
/* The message was sent, start the timer. */
45204523
intf_start_seq_timer(intf, msg->msgid);
4524+
requeue = 0;
4525+
goto out;
45214526
} else if (((msg->rsp[0] >> 2) != ((msg->data[0] >> 2) | 1))
45224527
|| (msg->rsp[1] != msg->data[1])) {
45234528
/*

drivers/char/ipmi/ipmi_si_intf.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,10 +2220,7 @@ static void cleanup_one_si(struct smi_info *smi_info)
22202220
return;
22212221

22222222
list_del(&smi_info->link);
2223-
2224-
if (smi_info->intf)
2225-
ipmi_unregister_smi(smi_info->intf);
2226-
2223+
ipmi_unregister_smi(smi_info->intf);
22272224
kfree(smi_info);
22282225
}
22292226

0 commit comments

Comments
 (0)