[{"id":3687574,"web_url":"http://patchwork.ozlabs.org/comment/3687574/","msgid":"<20260507080005.6BF59C2BCB8@smtp.kernel.org>","list_archive_url":null,"date":"2026-05-07T08:00:04","subject":"Re: [PATCH v8 phy-next 17/31] usb: gadget: tegra-xudc: avoid direct\n dereference of phy->dev.of_node","submitter":{"id":93311,"url":"http://patchwork.ozlabs.org/api/people/93311/","name":null,"email":"sashiko-bot@kernel.org"},"content":"Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:\n- [High] Missing error code assignment when `of_property_match_string()` fails.\n- [Low] Stray newline in error log format string.\n--\n\ncommit 4dab65591b625c1473fa4d0a6d9ad7c5d6b74f8e\nAuthor: Vladimir Oltean <vladimir.oltean@nxp.com>\n\nusb: gadget: tegra-xudc: avoid direct dereference of phy->dev.of_node\n\nThis commit reworks the Tegra XUDC driver to implement a parallel OF node\nlookup path based on the \"phys\" phandle and the #phy-cells of the padctl\nprovider. This avoids directly dereferencing phy->dev.of_node.\n\n> diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c\n> index e9d33be028664..f93e0a5651ab7 100644\n> --- a/drivers/usb/gadget/udc/tegra-xudc.c\n> +++ b/drivers/usb/gadget/udc/tegra-xudc.c\n[ ... ]\n> @@ -3515,7 +3516,10 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc)\n[ ... ]\n> +\t\tindex = of_property_match_string(np, \"phy-names\", phy_name);\n> +\t\tif (index < 0) {\n> +\t\t\tdev_err(xudc->dev,\n> +\t\t\t\t\"no \\\"phy-names\\\" entry for \\\"%s\\\": %pe\\n\",\n> +\t\t\t\tphy_name, ERR_PTR(index));\n> +\t\t\tgoto clean_up;\n\nWhen of_property_match_string() fails, index receives a negative error code,\nbut the err variable is not updated before the jump.\n\nBecause err remains 0, will tegra_xudc_phy_get() incorrectly return 0 (success)\nafter the clean_up block clears the PHY arrays to NULL?\n\n> +\t\t}\n> +\n> +\t\terr = of_parse_phandle_with_args(np, \"phys\", \"#phy-cells\",\n> +\t\t\t\t\t\t index, &args);\n> +\t\tif (err) {\n> +\t\t\tdev_err(xudc->dev,\n> +\t\t\t\t\"failed to follow \\\"%s\\\" reference\\n: %pe\\n\",\n\nThis isn't a bug, but there is an extra newline character right before the\ncolon in this format string.\n\nCould this be adjusted to prevent the log output from awkwardly splitting \nacross two lines in dmesg?\n\n> +\t\t\t\tphy_name, ERR_PTR(err));\n> +\t\t\tgoto clean_up;\n> +\t\t}","headers":{"Return-Path":"\n <linux-pci+bounces-54056-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=YDzqBBPv;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-54056-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"YDzqBBPv\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gB4Rt2Pgcz1yCg\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 07 May 2026 18:00:26 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id C6EFE3006F39\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  7 May 2026 08:00:19 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id AFB5437FF78;\n\tThu,  7 May 2026 08:00:08 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 594813382F0\n\tfor <linux-pci@vger.kernel.org>; Thu,  7 May 2026 08:00:06 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 6BF59C2BCB8;\n\tThu,  7 May 2026 08:00:05 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778140807; cv=none;\n b=TunLThEZH8xisIhygif/psyekRNaZHbsN3SiZXFpH44Gece/hyFZQCXixTiKnJbq6F1F9izkGoGmMccubbDTcH8yiKAYgUFVCkrIz+iiIswC3X8D2zsNi554mW3puMmBdifLzVn6q1vV9gxZN2SJaPmHIn92siYPDMdTk2HIG0w=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778140807; c=relaxed/simple;\n\tbh=7ZwbYkzLEXxB3Jt+BW5gluU8xy5uO5ls+LcUcmykheA=;\n\th=From:Subject:To:Cc:In-Reply-To:References:Content-Type:Date:\n\t Message-Id;\n b=XyH6clG+wBVRE9HxeZ9/qDThiIUoLLtnG4MNcJPsfRpuNNH36RpmnrqwcgRIK4YN50nyi3FhYu+ACRfrW+BKAh46Mbm4c/anm+vfwMuCGaSu3fCsDCw1A9mOKlWdWpXmEfw36Xjq2HXR8XtcfwJboI/mocb+dUTzZxvwGphCWC4=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=YDzqBBPv; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1778140805;\n\tbh=7ZwbYkzLEXxB3Jt+BW5gluU8xy5uO5ls+LcUcmykheA=;\n\th=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date:From;\n\tb=YDzqBBPvkbFz16EgeUr0EHCTmdAECuCJYHzQAlv1LrCzseOSoz2vQgdj45dbQ4Dd7\n\t 7S24s7WGMs3KOQBOEVEQs3MwqBUc12SeOht0W2AdRFyqolMrsji8nRbnenNevMD2gh\n\t SYHlqZy0r+KSFbXX3kJl5TQi8cuvDcU5WEqqNgZ+la91hkG+pClL8rlc2j0WVZtRJh\n\t N7+d7uy39wPNTPwKPAy+NcmuvuY5iYPQA/3qIu35EiKBuLKfIuTbHCTJNOwaRJn5LE\n\t Z9m4lpPJZuwvD0jSvGbpuxFfS2CgGPurd3Q1H5AxHj4AsBVsjePFNS2G7sN7KYutiP\n\t FQQ0s1/TsXBCA==","From":"sashiko-bot@kernel.org","Subject":"Re: [PATCH v8 phy-next 17/31] usb: gadget: tegra-xudc: avoid direct\n dereference of phy->dev.of_node","Reply-To":"sashiko@lists.linux.dev","To":"\"Vladimir Oltean\" <vladimir.oltean@nxp.com>","Cc":"linux-pci@vger.kernel.org, wsa+renesas@sang-engineering.com","In-Reply-To":"<20260505100523.1922388-18-vladimir.oltean@nxp.com>","References":"<20260505100523.1922388-18-vladimir.oltean@nxp.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","Date":"Thu, 07 May 2026 08:00:04 +0000","Message-Id":"<20260507080005.6BF59C2BCB8@smtp.kernel.org>","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>"}}]