From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0FCF8A0597; Thu, 9 Apr 2020 14:55:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DCA6C1C204; Thu, 9 Apr 2020 14:55:12 +0200 (CEST) Received: from huawei.com (szxga03-in.huawei.com [45.249.212.189]) by dpdk.org (Postfix) with ESMTP id 340F61C1D0; Thu, 9 Apr 2020 14:55:05 +0200 (CEST) Received: from DGGEMM402-HUB.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id DE8DEC87936755A5693B; Thu, 9 Apr 2020 20:54:06 +0800 (CST) Received: from DGGEMM423-HUB.china.huawei.com (10.1.198.40) by DGGEMM402-HUB.china.huawei.com (10.3.20.210) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 9 Apr 2020 20:54:06 +0800 Received: from DGGEMM533-MBX.china.huawei.com ([169.254.5.250]) by dggemm423-hub.china.huawei.com ([10.1.198.40]) with mapi id 14.03.0487.000; Thu, 9 Apr 2020 20:53:56 +0800 From: wangyunjian To: Ferruh Yigit , "dev@dpdk.org" CC: "keith.wiles@intel.com" , "Lilijun (Jerry)" , xudingke , "stable@dpdk.org" Thread-Topic: [dpdk-stable] [dpdk-dev] [PATCH v3 1/5] net/tap: fix mbuf double free when writev fails Thread-Index: AQHWDJQwM6tuRoHS7UepKkZmbgTyLqhtEp+AgANU8KD//6JJgIAAr25g Date: Thu, 9 Apr 2020 12:53:56 +0000 Message-ID: <34EFBCA9F01B0748BEB6B629CE643AE60CF60039@DGGEMM533-MBX.china.huawei.com> References: <1586233357-2580-1-git-send-email-wangyunjian@huawei.com> <34EFBCA9F01B0748BEB6B629CE643AE60CF5FDB2@DGGEMM533-MBX.china.huawei.com> In-Reply-To: Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.173.251.152] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 1/5] net/tap: fix mbuf double free when writev fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogRmVycnVoIFlpZ2l0IFtt YWlsdG86ZmVycnVoLnlpZ2l0QGludGVsLmNvbV0NCj4gU2VudDogVGh1cnNkYXksIEFwcmlsIDks IDIwMjAgNTo1MiBQTQ0KPiBUbzogd2FuZ3l1bmppYW4gPHdhbmd5dW5qaWFuQGh1YXdlaS5jb20+ OyBkZXZAZHBkay5vcmcNCj4gQ2M6IGtlaXRoLndpbGVzQGludGVsLmNvbTsgTGlsaWp1biAoSmVy cnkpIDxqZXJyeS5saWxpanVuQGh1YXdlaS5jb20+OyB4dWRpbmdrZQ0KPiA8eHVkaW5na2VAaHVh d2VpLmNvbT47IHN0YWJsZUBkcGRrLm9yZw0KPiBTdWJqZWN0OiBSZTogW2RwZGstc3RhYmxlXSBb ZHBkay1kZXZdIFtQQVRDSCB2MyAxLzVdIG5ldC90YXA6IGZpeCBtYnVmIGRvdWJsZQ0KPiBmcmVl IHdoZW4gd3JpdGV2IGZhaWxzDQo+IA0KPiBPbiA0LzkvMjAyMCA5OjAzIEFNLCB3YW5neXVuamlh biB3cm90ZToNCj4gPg0KPiA+DQo+ID4+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+ID4+ IEZyb206IEZlcnJ1aCBZaWdpdCBbbWFpbHRvOmZlcnJ1aC55aWdpdEBpbnRlbC5jb21dDQo+ID4+ IFNlbnQ6IFR1ZXNkYXksIEFwcmlsIDcsID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