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 0B9C4A0597; Thu, 9 Apr 2020 10:03:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 750181C1B0; Thu, 9 Apr 2020 10:03:35 +0200 (CEST) Received: from huawei.com (szxga03-in.huawei.com [45.249.212.189]) by dpdk.org (Postfix) with ESMTP id 818841C1A6; Thu, 9 Apr 2020 10:03:34 +0200 (CEST) Received: from DGGEMM402-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 36AE3504EF27B22C1612; Thu, 9 Apr 2020 16:03:31 +0800 (CST) Received: from DGGEMM424-HUB.china.huawei.com (10.1.198.41) by DGGEMM402-HUB.china.huawei.com (10.3.20.210) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 9 Apr 2020 16:03:30 +0800 Received: from DGGEMM533-MBX.china.huawei.com ([169.254.5.250]) by dggemm424-hub.china.huawei.com ([10.1.198.41]) with mapi id 14.03.0487.000; Thu, 9 Apr 2020 16:03:24 +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+AgANU8KA= Date: Thu, 9 Apr 2020 08:03:23 +0000 Message-ID: <34EFBCA9F01B0748BEB6B629CE643AE60CF5FDB2@DGGEMM533-MBX.china.huawei.com> References: <1586233357-2580-1-git-send-email-wangyunjian@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 YWlsdG86ZmVycnVoLnlpZ2l0QGludGVsLmNvbV0NCj4gU2VudDogVHVlc2RheSwgQXByaWwgNywg MjAyMCA4OjM1IFBNDQo+IFRvOiB3YW5neXVuamlhbiA8d2FuZ3l1bmppYW5AaHVhd2VpLmNvbT47 IGRldkBkcGRrLm9yZw0KPiBDYzoga2VpdGgud2lsZXNAaW50ZWwuY29tOyBMaWxpanVuIChKZXJy eSkgPGplcnJ5LmxpbGlqdW5AaHVhd2VpLmNvbT47IHh1ZGluZ2tlDQo+IDx4dWRpbmdrZUBodWF3 ZWkuY29tPjsgc3RhYmxlQGRwZGsub3JnDQo+IFN1YmplY3Q6IFJlOiBbZHBkay1zdGFibGVdIFtk cGRrLWRldl0gW1BBVENIIHYzIDEvNV0gbmV0L3RhcDogZml4IG1idWYgZG91YmxlDQo+IGZyZWUg d2hlbiB3cml0ZXYgZmFpbHMNCj4gDQo+IE9uIDQvNy8yMDIwIDU6MjIgQU0sIHdhbmd5dW5qaWFu IHdyb3RlOg0KPiA+IEZyb206IFl1bmppYW4gV2FuZyA8d2FuZ3l1bmppYW5AaHVhd2VpLmNvbT4N Cj4gPg0KPiA+IFdoZW4gdGhlIHRhcF93cml0ZV9tYnVmcygpIGZ1bmN0aW9uIHJldHVybiB3aXRo IGJyZWFrLCBtYnVmIHdhcyBmcmVlZA0KPiA+IHdpdGhvdXQgaW5jcmVtZW50aW5nIG51bV9wYWNr ZXRzLiBUaGlzIG1heSBsZWFkIGFwcGx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