]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: r8a66597: Add missing null check on return from platform_get_resource
authorColin Ian King <colin.king@canonical.com>
Tue, 6 Apr 2021 18:45:10 +0000 (19:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Apr 2021 14:02:26 +0000 (16:02 +0200)
commit1c8a1ea8acdf5b4add223653866d513947f6aadc
tree9d120282c0fa7f2e313a8f409ebcb1970457d37a
parent349243e36d9ae3d7538a9bcc08efe8da39eae4e6
usb: gadget: r8a66597: Add missing null check on return from platform_get_resource

The call to platform_get_resource can potentially return a NULL pointer
on failure, so add this check and return -EINVAL if it fails.

Fixes: 20bdf4542695 ("usb: gadget: R8A66597 peripheral controller support.")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Dereference null return")
Link: https://lore.kernel.org/r/20210406184510.433497-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/r8a66597-udc.c