]> 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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Fri, 11 Aug 2017 10:37:43 +0000 (12:37 +0200)
BugLink: http://bugs.launchpad.net/bugs/1707233
commit 4495ec6d770e1bca7a04e93ac453ab6720c56c5d upstream.

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>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/char/ipmi/ipmi_ssif.c

index 0d83cfb9708f0359c05bafca98e5d96931628360..f53e8ba2c718feda58050d20f37c0f0eff1db4f5 100644 (file)
@@ -758,6 +758,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 {