]> git.dujemihanovic.xyz Git - u-boot.git/commit
dm: usb: ehci: avoid possible NULL dereference
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Mon, 20 Nov 2017 18:33:39 +0000 (19:33 +0100)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Sun, 26 Nov 2017 01:22:36 +0000 (02:22 +0100)
commit45157d27644c23493ea1b5a6c9dd67572eb75c8c
tree3ef338adaef3d0baea06901a722d0195ae24e244
parente1cc60c0d635408b18a31dcdc2002bba07da21a4
dm: usb: ehci: avoid possible NULL dereference

Currently we check in ehci_shutdown() if ctrl is NULL after
dereferencing it.

Before this we have already dereferenced ctrl, ctrl->hccr,
and ctrl->hcor in ehci_get_portsc_register(), ehci_submit_root(),
and hci_common_init().

A better approach is to already check ctrl, ctrl->hccr, and ctrl->hcor
during the initialization in ehci_register() and usb_lowlevel_init()
and signal an error here via the return code.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
drivers/usb/host/ehci-hcd.c