]> git.baikalelectronics.ru Git - kernel.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)
committerPeter Chen <peter.chen@nxp.com>
Tue, 25 Oct 2016 08:14:32 +0000 (16:14 +0800)
commit72c5f09d3e8f095f7b2a407f1ed5c2e3dac49249
tree00d35bd3a40530c43f17e5ec91223e494770068d
parent34a6cfcbd113a3351dd99b3e7954cf59418b122c
usb: chipidea: host: fix NULL ptr dereference during shutdown

After commit 71097a35f8cf ("usb: chipidea: implement platform shutdown
callback") and commit deb1f5bdc371 ("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: 71097a35f8cf ("usb: chipidea: implement platform shutdown callback")
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/chipidea/host.c