Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941009AbcKNXb4 (ORCPT ); Mon, 14 Nov 2016 18:31:56 -0500 Received: from mail-bl2nam02on0101.outbound.protection.outlook.com ([104.47.38.101]:31136 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932174AbcKNXbx (ORCPT ); Mon, 14 Nov 2016 18:31:53 -0500 From: KY Srinivasan To: Dexuan Cui , Bjorn Helgaas , "linux-pci@vger.kernel.org" , "devel@linuxdriverproject.org" CC: "gregkh@linuxfoundation.org" , Haiyang Zhang , Stephen Hemminger , "Jake Oshins" , Hadden Hoppert , "Vitaly Kuznetsov" , "jasowang@redhat.com" , "apw@canonical.com" , "olaf@aepfle.de" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 1/3] PCI: hv: use the correct buffer size in new_pcichild_device() Thread-Topic: [PATCH 1/3] PCI: hv: use the correct buffer size in new_pcichild_device() Thread-Index: AdI7IoRA7oW02ygCRFeoAZworZG8EQDp92qA Date: Mon, 14 Nov 2016 22:58:55 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=kys@microsoft.com; x-originating-ip: [2001:4898:80e8:6::3e6] x-microsoft-exchange-diagnostics: 1;DM5PR03MB2667;7:QPygi9aqkW+S3UyEuxrwgP3yQUi+Q+SAs1yY+2x7pF6KJ61YhR3CdCE11/cNCApqtGxZzuJIPfHrPdmBPDQu6Z9AnTtP8rxZFyMYQ8G0hPmAO/mCU69GtIX8piwkRIjcCITWTtFZW12LFkc5Ykc25kIVjdY/YcmcByEhEJYy+8fUI9NW+pSeIBtM30wJZBB3/O9uCcV36o6kls5VpgkBkqPDwzwt+nBFhZ0Cm/ncLiQT4mwlpQJbzjjAINYr80zZsJkJWk0caZqJ2qmsDqPU5vYcOH9qfBFAjpBUZoRTTdybqPXD9Mw72H1UBWo3Fqe0tgnQRQJ1doBu9aEXk5B1qSGy8oKdq9WGc1hM0uK1YoYM85pwPoUGs52udwuMQFE9 x-ms-office365-filtering-correlation-id: 031714c9-fb25-415c-50f3-08d40ce1cfe1 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR03MB2667; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(211936372134217)(198206253151910); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6045074)(6060326)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(61426038)(61427038)(6061324)(6046074);SRVR:DM5PR03MB2667;BCL:0;PCL:0;RULEID:;SRVR:DM5PR03MB2667; x-forefront-prvs: 0126A32F74 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(13464003)(377454003)(189002)(199003)(2501003)(76176999)(50986999)(92566002)(33656002)(54356999)(2900100001)(3660700001)(3280700002)(77096005)(2906002)(102836003)(6116002)(2561002)(3900700001)(122556002)(5001770100001)(76576001)(97736004)(2421001)(4326007)(9686002)(8936002)(99286002)(189998001)(7696004)(5660300001)(101416001)(2950100002)(68736007)(1511001)(8676002)(86362001)(8990500004)(81156014)(105586002)(305945005)(7736002)(5005710100001)(10090500001)(2201001)(7846002)(86612001)(87936001)(81166006)(10290500002)(74316002)(106356001)(229853002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR03MB2667;H:DM5PR03MB2490.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2016 22:58:55.9336 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2667 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uAENW3hc023765 Content-Length: 1788 Lines: 54 > -----Original Message----- > From: Dexuan Cui > Sent: Wednesday, November 9, 2016 11:18 PM > To: Bjorn Helgaas ; linux-pci@vger.kernel.org; > devel@linuxdriverproject.org > Cc: gregkh@linuxfoundation.org; KY Srinivasan ; > Haiyang Zhang ; Stephen Hemminger > ; Jake Oshins ; Hadden > Hoppert ; Vitaly Kuznetsov > ; jasowang@redhat.com; apw@canonical.com; > olaf@aepfle.de; linux-kernel@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 > CC: Jake Oshins > Cc: KY Srinivasan > CC: Haiyang Zhang > CC: Vitaly Kuznetsov Thanks Dexuan. Acked-by: K. Y. Srinivasan > --- > 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