summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2016-11-10 07:17:48 +0000
committerBjorn Helgaas <bhelgaas@google.com>2016-11-16 16:43:58 -0600
commit8286e96d95f2dd01a72e3500322ad95153a469c2 (patch)
tree98b3d10b2ea418147501530eaba6bd24f086aa88
parent542ccf4551fa019a8ae9dfb7c8cd7e73a3d7e614 (diff)
downloadlinux-8286e96d95f2dd01a72e3500322ad95153a469c2.tar.bz2
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>
-rw-r--r--drivers/pci/host/pci-hyperv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 06c98695c06c..9ea63b4b0e58 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/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 pci_child_message *res_req;
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;
unsigned long flags;
int ret;