瀏覽代碼

PCI: hv: Use the correct buffer size in new_pcichild_device()

We don't really need such a big on-stack buffer.  vmbus_sendpacket() here
only uses sizeof(struct pci_child_message).

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jake Oshins <jakeo@microsoft.com>
Dexuan Cui 8 年之前
父節點
當前提交
8286e96d95
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      drivers/pci/host/pci-hyperv.c

+ 3 - 3
drivers/pci/host/pci-hyperv.c

@@ -1271,9 +1271,9 @@ static struct hv_pci_dev *new_pcichild_device(struct hv_pcibus_device *hbus,
 	struct hv_pci_dev *hpdev;
 	struct hv_pci_dev *hpdev;
 	struct pci_child_message *res_req;
 	struct pci_child_message *res_req;
 	struct q_res_req_compl comp_pkt;
 	struct q_res_req_compl comp_pkt;
-	union {
-	struct pci_packet init_packet;
-		u8 buffer[0x100];
+	struct {
+		struct pci_packet init_packet;
+		u8 buffer[sizeof(struct pci_child_message)];
 	} pkt;
 	} pkt;
 	unsigned long flags;
 	unsigned long flags;
 	int ret;
 	int ret;