[PATCH] IPMI: fix handling of OEM flags
authorCorey Minyard <[email protected]>
Sat, 16 Sep 2006 19:15:41 +0000 (12:15 -0700)
committerLinus Torvalds <[email protected]>
Sat, 16 Sep 2006 19:54:31 +0000 (12:54 -0700)
If one of the OEM flags becomes set in the flags from the hardware, the
driver could hang if no OEM handler was set.  Fix the code to handle this.
This was tested by setting the flags by hand after they were fetched.

Signed-off-by: Corey Minyard <[email protected]>
Ackde-by: Matt Domsch <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/char/ipmi/ipmi_si_intf.c

index 31b59403b6323fa04467ef7807f620514385813d..abca98beac14507471537abfc50403e06d10abdf 100644 (file)
@@ -402,10 +402,10 @@ static void handle_flags(struct smi_info *smi_info)
                        smi_info->curr_msg->data,
                        smi_info->curr_msg->data_size);
                smi_info->si_state = SI_GETTING_EVENTS;
-       } else if (smi_info->msg_flags & OEM_DATA_AVAIL) {
-               if (smi_info->oem_data_avail_handler)
-                       if (smi_info->oem_data_avail_handler(smi_info))
-                               goto retry;
+       } else if (smi_info->msg_flags & OEM_DATA_AVAIL &&
+                  smi_info->oem_data_avail_handler) {
+               if (smi_info->oem_data_avail_handler(smi_info))
+                       goto retry;
        } else {
                smi_info->si_state = SI_NORMAL;
        }