From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754686AbbITQR0 (ORCPT ); Sun, 20 Sep 2015 12:17:26 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:55234 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753479AbbITQRZ (ORCPT ); Sun, 20 Sep 2015 12:17:25 -0400 Date: Sun, 20 Sep 2015 11:16:55 -0500 From: Felipe Balbi To: Sudip Mukherjee CC: Felipe Balbi , Thomas Dahlmann , Greg Kroah-Hartman , , , Subject: Re: [PATCH 00/16] usb: gadget: amd5536udc: fix memory leaks Message-ID: <20150920161655.GC1447@saruman.tx.rr.com> Reply-To: References: <1442243583-24741-1-git-send-email-sudipm.mukherjee@gmail.com> <20150918183954.GD7636@saruman.tx.rr.com> <20150919035438.GA666@sudip-pc> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UFHRwCdBEJvubb2X" Content-Disposition: inline In-Reply-To: <20150919035438.GA666@sudip-pc> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --UFHRwCdBEJvubb2X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sat, Sep 19, 2015 at 09:24:38AM +0530, Sudip Mukherjee wrote: > On Fri, Sep 18, 2015 at 01:39:54PM -0500, Felipe Balbi wrote: > > On Mon, Sep 14, 2015 at 08:42:47PM +0530, Sudip Mukherjee wrote: > > > This amd5536udc was a complete mess. The major problems that i could > > > find are: > > >=20 > > > 1) if udc_pci_probe() fails in any stage then it just calls the > > > udc_pci_remove() to handle error. And udc_pci_remove() works with > > > struct udc *dev which we get from pci_get_drvdata(pdev). But we do the > > > pci_set_drvdata(pdev, dev) almost at the end of probe. So basically > > > incase of error we are handling the error by dereferencing a NULL > > > pointer. > > >=20 > > > 2) udc_pci_remove() does a BUG_ON(dev->driver !=3D NULL) and dev->dri= ver > > > will be set only if probe is success. So that means if probe fails th= en > > > probe will call udc_pci_remove() for error handling and udc_pci_remov= e() > > > will inturn halts the kernel by calling BUG(). > > >=20 > > > And apart from these numerous memory leaks and not releasing of > > > resources. Here comes a rewrite of few of the functions in an > > > attempt to fix these. > >=20 > > run checkpatch.pl and try again > I know checkpatch gives warning on some of my patches but as the warning > was not related to the part I have modified so I have not done any thing > with them as they will become unrelated changes than what is mentioned > in the commit log. > Anyways, I will fix up all the warnings and send v2. But do you want me > to also fix the checkpatch warnings in those patch where functions are > rearranged? Because in those patches functions were just moved and there > was no change in the body of the function. sure, just add a note "while at that, also fix checkpatch warnings" --=20 balbi --UFHRwCdBEJvubb2X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV/tv3AAoJEIaOsuA1yqRErCcP/33FHP4YHn+CoereS964pMgI 3Sa7u6UtyUsEjcL8Ulvc+NGvg+iWze2a+LpHxFt6h+bbrbaV3aBBdrfT15/k6hq5 6lN9abUREy1DroopMlzKpFCxRzc/1HFYLfC4Gga8ObkZPt2WRxHiMRf9QEPPKuRy ipLSGrdxJ7jAwbDeMST43J9J5D98aggKgX2ZPceSUT4LY2TEpn00dU4lVBlSndy4 aolMOBrBseNDLfuFCS4GTWKW2Fmo2mGpolAi4AiR/VuWn2A9xP5ynMcdx1PoEa0p mnUt2BGSzQj7jCkXAiYBMcaB1aMSk7Y7DWPE1M/BNJqwEa+QOtDXMAy7PVJ+Z3Os bJM5kpcirkn0pCdaG6xjfnpSKsAvfjhAvo95V69+Hc9pYrNecHDr+AWljssdl0FZ oHPqYpmEpopYkk7XBA/R9LGPqEU0gjbOV+M5s0WmBVgMXfSLE7TgtNkly+0xx1LD gz6UjKBG6t1Dwqn7kwy86xldOC6eshXNZUFpjWukuQvI7J9QXuoL2hUMNL8oNSsE lnEfswYeCp9jazvFYlZ4A3EOdJBg+NRU1MOEP//cNzowIbwwWkrTX1XkeDEJSxCV dH+J8bPzBTIgIeZ7PtFRGsHap8K8j1SjRSZnqbzHRT3iF/tGgNrVWpcDCwQM3CRf +xin2MVaZkVnxMYsxLlr =WstA -----END PGP SIGNATURE----- --UFHRwCdBEJvubb2X--