[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150911142101.GA19150@sudip-pc>
Date: Fri, 11 Sep 2015 19:51:01 +0530
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Felipe Balbi <balbi@...com>
Cc: David Cohen <david.a.cohen@...ux.intel.com>,
Thomas Dahlmann <dahlmann.thomas@...or.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, linux-geode@...ts.infradead.org,
linux-usb@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: amd5536udc: fix NULL pointer dereference
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?
regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists