]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
ipmi:ssif: Add missing unlock in error branch
authorCorey Minyard <cminyard@mvista.com>
Fri, 30 Jun 2017 12:18:08 +0000 (07:18 -0500)
committerCorey Minyard <cminyard@mvista.com>
Fri, 30 Jun 2017 12:18:08 +0000 (07:18 -0500)
When getting flags, a response to a different message would
result in a deadlock because of a missing unlock.  Add that
unlock and a comment.  Found by static analysis.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@vger.kernel.org # 3.19
Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/ipmi_ssif.c

index 971ecda3365788f2f0a784245ab4eb4489e1724b..0aea3bcb615848f65d9eef06806cbacf2ae92ed3 100644 (file)
@@ -766,6 +766,11 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
                               result, len, data[2]);
                } else if (data[0] != (IPMI_NETFN_APP_REQUEST | 1) << 2
                           || data[1] != IPMI_GET_MSG_FLAGS_CMD) {
+                       /*
+                        * Don't abort here, maybe it was a queued
+                        * response to a previous command.
+                        */
+                       ipmi_ssif_unlock_cond(ssif_info, flags);
                        pr_warn(PFX "Invalid response getting flags: %x %x\n",
                                data[0], data[1]);
                } else {