Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5b45b7b authored by Dexuan Cui's avatar Dexuan Cui Committed by Bjorn Helgaas
Browse files

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: default avatarDexuan Cui <decui@microsoft.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarKY Srinivasan <kys@microsoft.com>
CC: Jake Oshins <jakeo@microsoft.com>
CC: Haiyang Zhang <haiyangz@microsoft.com>
CC: Vitaly Kuznetsov <vkuznets@redhat.com>
parent 665e2245
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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,
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);
}