diff options
author | Dexuan Cui <decui@microsoft.com> | 2016-08-23 04:49:22 (GMT) |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-09-06 17:23:30 (GMT) |
commit | a5b45b7b952822aa5fbe842d2ee497c7c9dd7f55 (patch) | |
tree | 69235d2da14b4f654b522f25428f027a05cfe81e | |
parent | 665e2245eb46a217926d45031b83f1212a1bb344 (diff) | |
download | linux-a5b45b7b952822aa5fbe842d2ee497c7c9dd7f55.tar.xz |
PCI: hv: Handle hv_pci_generic_compl() error case
'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>
-rw-r--r-- | drivers/pci/host/pci-hyperv.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index e9307af..763ff87 100644 --- a/drivers/pci/host/pci-hyperv.c +++ b/drivers/pci/host/pci-hyperv.c @@ -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); } |