]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: check port array allocation was successful before dereferencing it
authorMathias Nyman <mathias.nyman@linux.intel.com>
Tue, 6 Apr 2021 07:02:05 +0000 (10:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Apr 2021 09:16:55 +0000 (11:16 +0200)
commit1c2abb53ba824e66b16fcd369eec17f1d3a341ff
tree25039f22a517795949657bccb08a531a107ed2c8
parentaf1a34372f718529b5d34c8583f1b412542e0077
xhci: check port array allocation was successful before dereferencing it

return if rhub->ports is null after rhub->ports = kcalloc_node()
Klockwork reported issue

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20210406070208.3406266-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c