]> git.baikalelectronics.ru Git - kernel.git/commit
ipmi:ssif: Check for NULL msg when handling events and messages
authorCorey Minyard <cminyard@mvista.com>
Fri, 1 Apr 2022 12:44:53 +0000 (07:44 -0500)
committerCorey Minyard <cminyard@mvista.com>
Thu, 12 May 2022 15:00:03 +0000 (10:00 -0500)
commit34efe73b47a98020e7a89ebae35a9a05b813d992
treef8cee97a9550d910611bf4c36197ae8ab3d30299
parent1d049effe55cc03318bfae46e5d69ba4cb1301ef
ipmi:ssif: Check for NULL msg when handling events and messages

Even though it's not possible to get into the SSIF_GETTING_MESSAGES and
SSIF_GETTING_EVENTS states without a valid message in the msg field,
it's probably best to be defensive here and check and print a log, since
that means something else went wrong.

Also add a default clause to that switch statement to release the lock
and print a log, in case the state variable gets messed up somehow.

Reported-by: Haowen Bai <baihaowen@meizu.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/ipmi_ssif.c