From patchwork Sun Jul 16 15:53:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1808474 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=yT6YFqXa; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=aCey2UA7; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R3qWn3Srdz20Dw for ; Mon, 17 Jul 2023 01:53:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6AD7B86371; Sun, 16 Jul 2023 17:53:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1689522831; bh=z4dfcu/d7J3SmFNXuqLwpTtpYMVK7iYxxWyM86Wmqy4=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=yT6YFqXaD+LhPvCpjZ5otbacsdQ3gCNBf3vQ2llvImi51E/Yp9w0ElGijywpZpnCs Y3e4+D8eEOUiq5hYlRqqyKbiAVnCidN/R9l+Jl+jDrhpLTKVuHo7dH0VxwghHn4Qna mNYRXF6ksqXSvCbUlWLT96Cmz15z4OSRLn3QXBxzeoYEKfPfzDD8B7D2MeOzsJtopY mPUhqPCgdnTp9V8Qg3n02l8QEMNxIwPRh01+ybYRFxQ0p8+2JZ0c2hF7+aJJxrfU8F D711/t9CBhgbc5aFLkvZJxMnQVNAoUZfadIhFVuJiyNcEnflS9tEBnR8kaNO/lHF6L hwG87v5Va2aGQ== Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 681FD86354; Sun, 16 Jul 2023 17:53:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1689522829; bh=z4dfcu/d7J3SmFNXuqLwpTtpYMVK7iYxxWyM86Wmqy4=; h=From:To:Cc:Subject:Date:From; b=aCey2UA7qwgz3mpogI5+YieqRHpt82e2lxyGS9gHuvmeIwt5DLrpuuDfNHaJwB0hN TlQ7aOLI90EEGefGkdpHIQyi3Z6F1lZycj3tJyUuiZl9PNgLe41TeveXmTW/MPoVzy B5Cs9qJdUdNkGLtrDwXCiGE6Hemy4vwe3nO59rOlwptAU6OOhGYmKRrLc808ojuJSI O9Xma6svenLWG3RZkIpkEkXV1df+CN4atClHPPkxgb65kbhVAYt2sYE1QiYsKVeJ1B Jwx+f3ixLgeI59jXRXjYdGECFKjwGhoPM2W2qg85PIM6SWod4WItUvb5AZUu+fnzZ7 kt4Cp2DSipGeg== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Jonas Karlman , Chunfeng Yun , GSS_MTK_Uboot_upstream , Ryder Lee , Weijie Gao Subject: [PATCH] usb: mtu3: Fix device_find_first_child() return value handling Date: Sun, 16 Jul 2023 17:53:46 +0200 Message-Id: <20230716155346.11241-1-marex@denx.de> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This function only ever returns 0, but may not assign the second parameter. Check the second parameter instead. Reported-by: Jonas Karlman Signed-off-by: Marek Vasut --- Cc: Chunfeng Yun Cc: GSS_MTK_Uboot_upstream Cc: Marek Vasut Cc: Ryder Lee Cc: Weijie Gao --- drivers/usb/mtu3/mtu3_plat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index b1b22b9357c..7eb8360eada 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -161,10 +161,10 @@ static int get_ssusb_rscs(struct udevice *dev, struct ssusb_mtk *ssusb) return -ENODEV; } - ret = device_find_first_child(dev, &child); - if (ret || !child) { - dev_err(dev, "failed to get child %d!\n", ret); - return ret; + device_find_first_child(dev, &child); + if (!child) { + dev_err(dev, "failed to get child!\n"); + return -ENODEV; } ssusb->mac_base = devfdt_remap_addr_name(child, "mac");