Content-Type: multipart/mixed; boundary="===============8419877412905930318==" MIME-Version: 1.0 From: Julia Lawall To: kbuild-all@lists.01.org Subject: [PATCH] usb: dwc3: fix for_each_child.cocci warnings Date: Sun, 22 May 2022 11:55:56 +0200 Message-ID: List-Id: --===============8419877412905930318== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: kernel test robot Add missing of_node_puts. Generated by: scripts/coccinelle/iterators/for_each_child.cocci CC: Harsh Agarwal Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- url: https://github.com/intel-lab-lkp/linux/commits/Harsh-Agarwal/Add-su= pport-for-multiport-controller/20220519-203742 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-= testing :::::: branch date: 3 days ago :::::: commit date: 3 days ago drivers/usb/dwc3/core.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1394,8 +1394,10 @@ static int dwc3_core_get_phy(struct dwc3 pr_err("usb2_phy gone %d\n", ret); if (ret =3D=3D -ENXIO || ret =3D=3D -ENODEV) dwc->usb2_phy[i] =3D NULL; - else + else { + of_node_put(port); return dev_err_probe(dev, ret, "no usb2 phy configured\n"); + } } if (IS_ERR(dwc->usb3_phy[i])) { @@ -1403,8 +1405,10 @@ static int dwc3_core_get_phy(struct dwc3 pr_err("usb3_phy gone %d\n", ret); if (ret =3D=3D -ENXIO || ret =3D=3D -ENODEV) dwc->usb3_phy[i] =3D NULL; - else + else { + of_node_put(port); return dev_err_probe(dev, ret, "no usb3 phy configured\n"); + } } //TODO Write Generic PHY API dwc->usb2_generic_phy =3D devm_phy_get(dev, "usb2-phy"); @@ -1412,8 +1416,10 @@ static int dwc3_core_get_phy(struct dwc3 ret =3D PTR_ERR(dwc->usb2_generic_phy); if (ret =3D=3D -ENOSYS || ret =3D=3D -ENODEV) dwc->usb2_generic_phy =3D NULL; - else + else { + of_node_put(port); return dev_err_probe(dev, ret, "no usb2 phy configured\n"); + } } //TODO Write Generic PHY API @@ -1422,8 +1428,10 @@ static int dwc3_core_get_phy(struct dwc3 ret =3D PTR_ERR(dwc->usb3_generic_phy); if (ret =3D=3D -ENOSYS || ret =3D=3D -ENODEV) dwc->usb3_generic_phy =3D NULL; - else + else { + of_node_put(port); return dev_err_probe(dev, ret, "no usb3 phy configured\n"); + } } i++; } --===============8419877412905930318==--