]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: chipidea: host: fix NULL ptr dereference during shutdown
authorStefan Wahren <stefan.wahren@i2se.com>
Sat, 10 Sep 2016 12:53:21 +0000 (12:53 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2016 15:38:56 +0000 (16:38 +0100)
commit086ac91804372caeef7e872e0d151fcfb2303932
treea3a95a7a823ab430caa575f8c4ee37b88daf4eca
parent07bae478e1c1c9c6040d69b52c44c550917045e2
usb: chipidea: host: fix NULL ptr dereference during shutdown

commit 991d5add50a5bb6ab8f12f2129f5c7487f6baaf6 upstream.

After commit b09b5224fe86 ("usb: chipidea: implement platform shutdown
callback") and commit 43a404577a93 ("usb: chipidea: host: set host to
be null after hcd is freed") a NULL pointer dereference is caused
on i.MX23 during shutdown. So ensure that role is set to CI_ROLE_END and
we finish interrupt handling before the hcd is deallocated. This avoids
the NULL pointer dereference.

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: b09b5224fe86 ("usb: chipidea: implement platform shutdown callback")
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/host.c