From: Felipe Balbi <balbi@ti.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>,
David Cohen <david.a.cohen@linux.intel.com>,
Thomas Dahlmann <dahlmann.thomas@arcor.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-kernel@vger.kernel.org>, <linux-geode@lists.infradead.org>,
<linux-usb@vger.kernel.org>
Subject: Re: [PATCH] usb: gadget: amd5536udc: fix NULL pointer dereference
Date: Fri, 11 Sep 2015 10:05:20 -0500 [thread overview]
Message-ID: <20150911150520.GE17326@saruman.tx.rr.com> (raw)
In-Reply-To: <20150911142101.GA19150@sudip-pc>
[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]
On Fri, Sep 11, 2015 at 07:51:01PM +0530, Sudip Mukherjee wrote:
> On Fri, Sep 11, 2015 at 08:28:34AM -0500, Felipe Balbi wrote:
> > Hi,
> >
> > On Fri, Sep 11, 2015 at 03:32:56PM +0530, Sudip Mukherjee wrote:
> > > On Thu, Sep 10, 2015 at 11:03:34AM -0700, David Cohen wrote:
> <snip>
> > no, the check is pointless. Most of these are. Just look at your probe()
> > and you'll see that if dev->virt_addr is NULL (meaning ioremap_nocache()
> > failed) you exit from probe() with error. The driver doesn't probe at
> > all. So you can be sure that by remove, dev->regs is valid.
> >
> > BTW, if probe fails, you have a TON of leaked resources!! You don't kfree()
> > dev, you don't pci_disable_device(), you don't release_mem_region(), you
> > don't iounmap() virt_addr, you don't free_irq().
> >
> > Also the iounmap() call in remove is wrong. You ioremapped
> > dev->virt_addr but iounmap() dev->regs. Are you SURE that's ok ?
> >
> > Man, what a mess! You gotta fix that up.
> :(
> Yes, total mess. I am on it.
> BTW, while I am fixing it can i also include a patch which will
> rearrange the functions and remove the forward declarations?
sure, just make sure fixes and cleanups are separate. First all fixes,
then cleanups and reorderings.
cheers
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-09-11 15:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 11:42 [PATCH] usb: gadget: amd5536udc: fix NULL pointer dereference Sudip Mukherjee
2015-09-10 18:03 ` David Cohen
2015-09-11 10:02 ` Sudip Mukherjee
2015-09-11 13:28 ` Felipe Balbi
2015-09-11 14:21 ` Sudip Mukherjee
2015-09-11 15:05 ` Felipe Balbi [this message]
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=20150911150520.GE17326@saruman.tx.rr.com \
--to=balbi@ti.com \
--cc=dahlmann.thomas@arcor.de \
--cc=david.a.cohen@linux.intel.com \
--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