]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
USB: ehci-ppc-of: problems in unwind
authorDan Carpenter <error27@gmail.com>
Sat, 14 Aug 2010 09:06:19 +0000 (11:06 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:36:18 +0000 (13:36 -0700)
commit654931d5fa6ad8aec46c6220d800235f2085eef6
tree1c2f11eb27d97a1d9c4dbc2b41eb8bb2c36e9912
parentab36a5f7408546676c79ce7bd20633a5a76ecb58
USB: ehci-ppc-of: problems in unwind

commit 08a3b3b1c2e622e378d9086aee9e2e42ce37591d upstream.

The iounmap(ehci->ohci_hcctrl_reg); should be the first thing we do
because the ioremap() was the last thing we did.  Also if we hit any of
the goto statements in the original code then it would have led to a
NULL dereference of "ehci".  This bug was introduced in: 796bcae7361c
"USB: powerpc: Workaround for the PPC440EPX USBH_23 errata [take 3]"

I modified the few lines in front a little so that my code didn't
obscure the return success code path.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/ehci-ppc-of.c