> -----Original Message-----
> From: Dexuan Cui
> Sent: Wednesday, November 9, 2016 11:18 PM
> To: Bjorn Helgaas <bhelg...@google.com>; linux-...@vger.kernel.org;
> de...@linuxdriverproject.org
> Cc: gre...@linuxfoundation.org; KY Srinivasan <k...@microsoft.com>;
> Haiyang Zhang <haiya...@microsoft.com>; Stephen Hemminger
> <sthem...@microsoft.com>; Jake Oshins <ja...@microsoft.com>; Hadden
> Hoppert <hadd...@microsoft.com>; Vitaly Kuznetsov
> <vkuzn...@redhat.com>; jasow...@redhat.com; a...@canonical.com;
> o...@aepfle.de; linux-ker...@vger.kernel.org
> Subject: [PATCH 1/3] 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 <de...@microsoft.com>
> CC: Jake Oshins <ja...@microsoft.com>
> Cc: KY Srinivasan <k...@microsoft.com>
> CC: Haiyang Zhang <haiya...@microsoft.com>
> CC: Vitaly Kuznetsov <vkuzn...@redhat.com>

Thanks Dexuan.

Acked-by: K. Y. Srinivasan <k...@microsoft.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

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to