]> git.baikalelectronics.ru Git - uboot.git/commit
usb: xhci: Fix double free on failure
authorRichard Habeeb <richard.habeeb@gmail.com>
Mon, 24 Jul 2023 19:45:25 +0000 (15:45 -0400)
committerMarek Vasut <marex@denx.de>
Thu, 27 Jul 2023 01:59:38 +0000 (03:59 +0200)
commit48b19a2086a25486b6bd88ba8d09756c3152d293
tree372ab280a804bbd9ef84f3a882246d3dc19fe41a
parenta190818393fb3ffd72e6832b8302867418f2b104
usb: xhci: Fix double free on failure

drivers/core/device.c will call `device_free()` after xhci_register
already frees the private device data. This can cause a crash later
during the boot process, observed on aarch64 RPi4b as a synchronous
exception. All callers of xhci_register use priv_auto, so this won't
lead to memory leaks.

Signed-off-by: Richard Habeeb <richard.habeeb@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/usb/host/xhci.c