]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
PCI: hv: Handle hv_pci_generic_compl() error case
authorDexuan Cui <decui@microsoft.com>
Tue, 23 Aug 2016 04:49:22 +0000 (04:49 +0000)
committerLuis Henriques <luis.henriques@canonical.com>
Fri, 20 Jan 2017 13:04:58 +0000 (13:04 +0000)
BugLink: http://bugs.launchpad.net/bugs/1650059
'completion_status' is used in some places, e.g.,
hv_pci_protocol_negotiation(), so we should make sure it's initialized in
error case too, though the error is unlikely here.

[bhelgaas: fix changelog typo and nearby whitespace]
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: KY Srinivasan <kys@microsoft.com>
CC: Jake Oshins <jakeo@microsoft.com>
CC: Haiyang Zhang <haiyangz@microsoft.com>
CC: Vitaly Kuznetsov <vkuznets@redhat.com>
(cherry picked from commit a5b45b7b952822aa5fbe842d2ee497c7c9dd7f55)

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/pci/host/pci-hyperv.c

index e9307afa003d7046750274bbe0afb78dbbd8b5df..763ff87458288180dfd3ab19baf4e52a84fcfef3 100644 (file)
@@ -447,15 +447,16 @@ struct hv_pci_compl {
  * for any message for which the completion packet contains a
  * status and nothing else.
  */
-static
-void
-hv_pci_generic_compl(void *context, struct pci_response *resp,
-                    int resp_packet_size)
+static void hv_pci_generic_compl(void *context, struct pci_response *resp,
+                                int resp_packet_size)
 {
        struct hv_pci_compl *comp_pkt = context;
 
        if (resp_packet_size >= offsetofend(struct pci_response, status))
                comp_pkt->completion_status = resp->status;
+       else
+               comp_pkt->completion_status = -1;
+
        complete(&comp_pkt->host_event);
 }