Return-path: Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:36189 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751866AbdEQECv (ORCPT ); Wed, 17 May 2017 00:02:51 -0400 From: Xinming Hu To: Brian Norris , Ganapathi Bhat , Nishant Sarmukadam , Cathy Luo CC: "linux-kernel@vger.kernel.org" , "Dmitry Torokhov" , Amitkumar Karwar , Kalle Valo , "linux-wireless@vger.kernel.org" , "Doug Anderson" Subject: RE: [PATCH 01/11] mwifiex: fixup error cases in mwifiex_add_virtual_intf() Date: Wed, 17 May 2017 04:02:46 +0000 Message-ID: (sfid-20170517_060312_074122_F151BA10) References: <20170512164208.38725-1-briannorris@chromium.org> In-Reply-To: <20170512164208.38725-1-briannorris@chromium.org> Content-Type: text/plain; charset="gb2312" MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: SGksDQoNClRoaXMgcGF0Y2ggc2VyaWFscyBsb29rcyBmaW5lLCB0aGFua3MuDQoNCj4gLS0tLS1P cmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogbGludXgtd2lyZWxlc3Mtb3duZXJAdmdlci5r ZXJuZWwub3JnDQo+IFttYWlsdG86bGludXgtd2lyZWxlc3Mtb3duZXJAdmdlci5rZXJuZWwub3Jn XSBPbiBCZWhhbGYgT2YgQnJpYW4gTm9ycmlzDQo+IFNlbnQ6IDIwMTfE6jXUwjEzyNUgMDo0Mg0K PiBUbzogR2FuYXBhdGhpIEJoYXQ7IE5pc2hhbnQgU2FybXVrYWRhbQ0KPiBDYzogbGludXgta2Vy bmVsQHZnZXIua2VybmVsLm9yZzsgRG1pdHJ5IFRvcm9raG92OyBBbWl0a3VtYXIgS2Fyd2FyOyBL YWxsZQ0KPiBWYWxvOyBsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmc7IERvdWcgQW5kZXJz b247IEJyaWFuIE5vcnJpcw0KPiBTdWJqZWN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