From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934796AbbIVVRh (ORCPT ); Tue, 22 Sep 2015 17:17:37 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:45512 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933220AbbIVVRf (ORCPT ); Tue, 22 Sep 2015 17:17:35 -0400 Date: Tue, 22 Sep 2015 16:17:28 -0500 From: Felipe Balbi To: "Felipe F. Tonello" CC: , , Peter Chen , Greg Kroah-Hartman , Felipe Balbi , Andrzej Pietrasiewicz Subject: Re: [PATCH 3/3] usb: gadget: f_midi: free request when usb_ep_queue fails Message-ID: <20150922211728.GF7094@saruman.tx.rr.com> Reply-To: References: <1442948350-31702-1-git-send-email-eu@felipetonello.com> <1442948350-31702-3-git-send-email-eu@felipetonello.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VuQYccsttdhdIfIP" Content-Disposition: inline In-Reply-To: <1442948350-31702-3-git-send-email-eu@felipetonello.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --VuQYccsttdhdIfIP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 22, 2015 at 07:59:10PM +0100, Felipe F. Tonello wrote: > This fix a memory leak that will occur in this case. >=20 > Signed-off-by: Felipe F. Tonello > --- > drivers/usb/gadget/function/f_midi.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/fu= nction/f_midi.c > index e92aff5..e6a114b 100644 > --- a/drivers/usb/gadget/function/f_midi.c > +++ b/drivers/usb/gadget/function/f_midi.c > @@ -550,9 +550,11 @@ static void f_midi_transmit(struct f_midi *midi, str= uct usb_request *req) > int err; > =20 > err =3D usb_ep_queue(ep, req, GFP_ATOMIC); > - if (err < 0) > + if (err < 0) { > ERROR(midi, "%s queue req: %d\n", > midi->in_ep->name, err); > + free_ep_req(ep, req); sure this request won't be needed on the next time the tasklet is queued ? Although, this looks correct, let's try to make sure really is correct. --=20 balbi --VuQYccsttdhdIfIP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWAcVoAAoJEIaOsuA1yqREZLsQAJ72y/2nu0Q/N6Y0AF775RtQ HCACDrxQpC6P5Dl7Rr6ZoFAkvm712HFiKKXu0G9CAkvczn730Oga3ZZm+hDDzPhX /4Ht9j2WCJ92/pXaduHohrSIm184zlWZUBZ95nd93wPiKPaOS74XTYzCZ6s1EecE h7dJHE5BIfp/09JPOPkHXXSeNPa1Ez1dEZcjfjI+3NL1GaNYHuLqSthuZHb69ZVY /c774pt/oJZgCdy/UKbrrnsUjGWcmL6fxawsTO3Jj8WTow2hxD5Dd2NMGIoKszAe sPJ+a0DJ6r5L2N8Dpm6T5P5H951svTrQ9EvnLLl8d83oTUHbr+a89kZCJ31AtbE8 iWnClBQ6dAOXG12bWwM19MkOHEdTfJrWEtMyhNzqnX4I6rJD2ej/9Oj8pzBWk8hO a3EnA3IWg3mkKZ4Etuq47F0kWhJpM+N+UV1Cc07qnKoLcZm5V+jsTJjLOkkdgK4B pMPDgJuC6mbipLXrLuPbwN531MptRXK9ixVXIBGOEFyZDrPB7ASr02Mm45gjRPoH MhRKb8wwFfmlrf6mMN5AlinxLr2kRCowFNT8KmddzHGVcke2wrwTfijAJ+ajluUS NYQfukz2zPFSjfnU+xvEAAjy4rScerrYNGGF7oQSsyZ135qgRU+6MVZ1omMjTTW3 NTER/7YcC0dbwDrz+Tfb =WoRX -----END PGP SIGNATURE----- --VuQYccsttdhdIfIP--