From: Felipe Balbi <balbi@ti.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de>,
Felipe Balbi <balbi@ti.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-kernel@vger.kernel.org>, <linux-geode@lists.infradead.org>,
<linux-usb@vger.kernel.org>
Subject: Re: [PATCH 00/16] usb: gadget: amd5536udc: fix memory leaks
Date: Fri, 18 Sep 2015 13:39:54 -0500 [thread overview]
Message-ID: <20150918183954.GD7636@saruman.tx.rr.com> (raw)
In-Reply-To: <1442243583-24741-1-git-send-email-sudipm.mukherjee@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]
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:
>
> 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.
>
> 2) udc_pci_remove() does a BUG_ON(dev->driver != NULL) and dev->driver
> will be set only if probe is success. So that means if probe fails then
> probe will call udc_pci_remove() for error handling and udc_pci_remove()
> will inturn halts the kernel by calling BUG().
>
> 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.
run checkpatch.pl and try again
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-09-18 18:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-14 15:12 [PATCH 00/16] usb: gadget: amd5536udc: fix memory leaks Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 01/16] usb: gadget: amd5536udc: introduce free_dma_pools Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 02/16] usb: gadget: amd5536udc: rewrite init_dma_pools Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 03/16] usb: gadget: amd5536udc: rewrite udc_pci_probe Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 04/16] usb: gadget: amd5536udc: use WARN_ON Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 05/16] usb: gadget: amd5536udc: use free_dma_pools Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 06/16] usb: gadget: amd5536udc: remove unnecessary conditions Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 07/16] usb: gadget: amd5536udc: unmap virt_addr Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 08/16] usb: gadget: amd5536udc: remove forward declaration of udc_probe Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 09/16] usb: gadget: amd5536udc: remove forward declaration of udc_remote_wakeup Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 10/16] usb: gadget: amd5536udc: remove forward declaration of udc_create_dma_chain Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 11/16] usb: gadget: amd5536udc: remove forward declaration of udc_free_dma_chain Sudip Mukherjee
2015-09-14 15:12 ` [PATCH 12/16] usb: gadget: amd5536udc: remove forward declaration of udc_pci_* Sudip Mukherjee
2015-09-14 15:13 ` [PATCH 13/16] usb: gadget: amd5536udc: remove forward declaration of udc_basic_init Sudip Mukherjee
2015-09-14 15:13 ` [PATCH 14/16] usb: gadget: amd5536udc: NULL comparison Sudip Mukherjee
2015-09-14 15:13 ` [PATCH 15/16] usb: gadget: amd5536udc: remove multiple blank lines Sudip Mukherjee
2015-09-14 15:13 ` [PATCH 16/16] usb: gadget: amd5536udc: match alignment Sudip Mukherjee
2015-09-18 18:39 ` Felipe Balbi [this message]
2015-09-19 3:54 ` [PATCH 00/16] usb: gadget: amd5536udc: fix memory leaks Sudip Mukherjee
2015-09-20 8:12 ` Sudip Mukherjee
2015-09-20 16:17 ` Felipe Balbi
2015-09-21 12:48 ` Sudip Mukherjee
2015-09-21 14:42 ` Felipe Balbi
2015-09-20 16:16 ` Felipe Balbi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150918183954.GD7636@saruman.tx.rr.com \
--to=balbi@ti.com \
--cc=dahlmann.thomas@arcor.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-geode@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox