linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] PCI: hv: use the correct buffer size in new_pcichild_device()
@ 2016-11-10  7:17 Dexuan Cui
  2016-11-10 16:27 ` Jake Oshins
  2016-11-14 22:58 ` KY Srinivasan
  0 siblings, 2 replies; 5+ messages in thread
From: Dexuan Cui @ 2016-11-10  7:17 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, devel
  Cc: gregkh, KY Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Jake Oshins, Hadden Hoppert, Vitaly Kuznetsov, jasowang, apw,
	olaf, linux-kernel

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>
CC: Jake Oshins <jakeo@microsoft.com>
Cc: KY Srinivasan <kys@microsoft.com>
CC: Haiyang Zhang <haiyangz@microsoft.com>
CC: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 drivers/pci/host/pci-hyperv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 763ff87..93ed64a 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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-14 23:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-10  7:17 [PATCH 1/3] PCI: hv: use the correct buffer size in new_pcichild_device() Dexuan Cui
2016-11-10 16:27 ` Jake Oshins
2016-11-10 16:52   ` Dexuan Cui
2016-11-10 17:05     ` Jake Oshins
2016-11-14 22:58 ` KY Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).