]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: lpc32xx_udc: Fix refcount leak in lpc32xx_udc_probe
authorMiaoqian Lin <linmq006@gmail.com>
Fri, 3 Jun 2022 14:02:44 +0000 (18:02 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jun 2022 09:12:39 +0000 (11:12 +0200)
commit3515959abd427d94f909502112b4d8ab252ca0e6
treeb67e0fecfe7603265c29c749986d5d35c635dc11
parentb3740fd3fa34b1ff29e9aeaf34e27becaeaa00c2
usb: gadget: lpc32xx_udc: Fix refcount leak in lpc32xx_udc_probe

of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.
of_node_put() will check NULL pointer.

Fixes: ba198f21b866 ("USB: gadget driver for LPC32xx")
Cc: stable <stable@kernel.org>
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220603140246.64529-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/lpc32xx_udc.c