| Message ID | 20260901175210.482943-1-yuxiaozhang@google.com |
|---|---|
| State | New |
| Delegated to: | Jerome Forissier |
| Headers | show
Return-Path: <u-boot-bounces@lists.u-boot-project.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=H+2HXr11; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20251104 header.b=JDe87O+U; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.u-boot-project.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hZDY73pfMz1xwZ for <incoming@patchwork.ozlabs.org>; Wed, 02 Sep 2026 04:15:07 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 3CC674077E; Tue, 1 Sep 2026 18:15:04 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gnMuXAChsCVu; Tue, 1 Sep 2026 18:15:03 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver=<UNKNOWN> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1788286502; bh=FV1jKMkb+QaW9mrYKNx63nI020M+Ep4n0346clbLAJY=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=H+2HXr119Ls59QavUT/SBbH/23/TDY9JSadBwk6A3SLYrg9+f0g3VA6biBF2FxC2h xiUJQLy//XGg0lpayDVc9vVCgFQsOXVRFtWgWxhuWE3dAddsq7HwxwwWoyRhfi4fBA Qy5xFavaAP729TKSCcocqy8Lry6pEx+ft3X5AlACqARJSGPMqwacDsnEPsY0Sgze9Q vMraJV56g2a8Jn1Xm5yeE/7mdiAtJKM5/p/4++h4OAzjtsq76705ZqgfAuHQzHXVwm qYqXcZChFXLuTgIVzBhvoW2pI6+zuQrCVsVwlG4+cXGl2DW7gm5u9uN+eI0nuGAUTr NGsJl1om26wqQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 035CF40774; Tue, 1 Sep 2026 18:15:02 +0000 (UTC) X-Original-To: u-boot@lists.u-boot-project.org Delivered-To: u-boot@lists.u-boot-project.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists1.osuosl.org (Postfix) with ESMTP id D03F62FD for <u-boot@lists.u-boot-project.org>; Tue, 1 Sep 2026 17:52:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B60AB40597 for <u-boot@lists.u-boot-project.org>; Tue, 1 Sep 2026 17:52:37 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id qS8JOpxeLpJW for <u-boot@lists.u-boot-project.org>; Tue, 1 Sep 2026 17:52:36 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::1045; helo=mail-pj1-x1045.google.com; envelope-from=34xcxagskbrw0wzkcq1jcpiiqqing.eqow-dqqvnkuvu.w-dqqv-rtqlgev.qti@flex--yuxiaozhang.bounces.google.com; receiver=<UNKNOWN> Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20251104 header.b=JDe87O+U Received: from mail-pj1-x1045.google.com (mail-pj1-x1045.google.com [IPv6:2607:f8b0:4864:20::1045]) by smtp4.osuosl.org (Postfix) with ESMTPS id BFC8940532 for <u-boot@lists.u-boot-project.org>; Tue, 1 Sep 2026 17:52:36 +0000 (UTC) Received: by mail-pj1-x1045.google.com with SMTP id 98e67ed59e1d1-399311947f6so179733a91.0 for <u-boot@lists.u-boot-project.org>; Tue, 01 Sep 2026 10:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1788285156; x=1788889956; darn=lists.u-boot-project.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=FV1jKMkb+QaW9mrYKNx63nI020M+Ep4n0346clbLAJY=; b=JDe87O+UfEjCJff8H8W/KyOa/b2OGbOFVR5Sgz6jS/6GD3FIvXmukgq/ci9Ys5CImA X0SOPjTvDzIN2N3n5OFWkrpVwo47m2//8FJC+1XxfGba8CFZ/bUU/DW0Mo3AssvNsKDY Jln7qxVtUwl+zfgCXcZxYGu9K9/GGjFgHQIf5aa23HNVV3dwYfrMCA1MgQJr/528S9PT Kl6yF/p0kW0nbhTxVcKiW+cTyU4iEtymvJct4QSF5M+mZsWo7fJkoo+8u93Kn7DHOMdD uIVMcNBp6t5Ne2wjQ0FfDFiQDM0vKAVpbAVxNRunM0+wCxl7brkyqPAsmWkcBHe/ttiK hL9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788285156; x=1788889956; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=FV1jKMkb+QaW9mrYKNx63nI020M+Ep4n0346clbLAJY=; b=Z6GPDL/GFqo2uUP4N8pfwL4h05Ki/bGGifj/ubrbBd3jbNE+d/wanJIK9Gz1IzJ8za KXaQfde/Li2+wzDRi1AgZ/JOKxtWu7JZGiyZNnAD4UFnQ0CUdLhf9fftBN1uYuz4VRQ6 umNJNbE+pLdhBmSm4jo4HUcjsUp71yND7CWVkkiqmJHIFVCREhlSGD7DuzIkuNsUEfBF q5RQkXCDRD01DLPrDh/loMIlmpjnRqtwWhzesZ9QQFUDHmKADzoi2rPL5uc81TuK1jIq 2v/00j2O+3+hYJu99irjIEMSSpqaufnIwRX7YT7q1gJ4pdK/2YHOZfH5JTXavjWDgQhT Flpw== X-Forwarded-Encrypted: i=1; AKwUvBwGQrEcwrW6iYn02ceKVpqJpYMwPfTyGRWZTnUdncyD3eI143LN6KS1kPRV1EAYBgYlSN7ZdjU=@lists.u-boot-project.org X-Gm-Message-State: AFuF++nD+06pUqFV5PuNb61qPaQ0CctVJF2clOmndFrOhXpYyntIBR2Q lzDu9Gn/9uE7/+Bh2DB40PWg4LXISKYeOR5//8ERMD1v8h7gASJQ4wUf6p7QzT+Ods5mVWzSzdV ChS+vtbmstXThQYwSeUb0keww3A== X-Received: from dldz2-n1.prod.google.com ([2002:a05:701b:4182:10b0:142:e77e:11fa]) (user=yuxiaozhang job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4c8a:b0:398:dcfe:967a with SMTP id 98e67ed59e1d1-398dcfe9ebfmr21870018a91.17.1788285155610; Tue, 01 Sep 2026 10:52:35 -0700 (PDT) Date: Tue, 1 Sep 2026 10:51:42 -0700 In-Reply-To: <"<CAOOoKeR5oAcouuG1EO2fQNubKsfVB=O5qf0aj-FhSSGJeOH-LQ@mail.gmail.com>"> Mime-Version: 1.0 References: <"<CAOOoKeR5oAcouuG1EO2fQNubKsfVB=O5qf0aj-FhSSGJeOH-LQ@mail.gmail.com>"> X-Mailer: git-send-email 2.55.0.966.g6673acef38-goog Message-ID: <20260901175210.482943-1-yuxiaozhang@google.com> Subject: [PATCH] u-boot: fix error check in eth init From: Yuxiao Zhang <yuxiaozhang@google.com> To: u-boot@lists.denx.de Cc: Yuxiao Zhang <yuxiaozhang@google.com>, Jerome Forissier <jerome.forissier@arm.com>, Tom Rini <trini@konsulko.com>, u-boot@lists.u-boot-project.org Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Tue, 01 Sep 2026 18:14:57 +0000 X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion <u-boot.lists.u-boot-project.org> List-Unsubscribe: <https://lists.u-boot-project.org/mailman/options/u-boot>, <mailto:u-boot-request@lists.u-boot-project.org?subject=unsubscribe> List-Archive: <http://lists.u-boot-project.org/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.u-boot-project.org> List-Help: <mailto:u-boot-request@lists.u-boot-project.org?subject=help> List-Subscribe: <https://lists.u-boot-project.org/mailman/listinfo/u-boot>, <mailto:u-boot-request@lists.u-boot-project.org?subject=subscribe> Errors-To: u-boot-bounces@lists.u-boot-project.org |
| Series |
u-boot: fix error check in eth init
|
expand
|
On Tue, Sep 01, 2026 at 10:51:42AM -0700, Yuxiao Zhang wrote: > eth_start_udev can fail but errno could still be zero which causes the > function ignores the error silently. This fix catches the error > properly. > > Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com> Thanks. Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/net/eth-uclass.c b/net/eth-uclass.c index 5c437143a30..07ec59b97f0 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -289,8 +289,10 @@ int eth_start_udev(struct udevice *dev) if (priv->running) return 0; - if (!device_active(dev)) + if (!device_active(dev)) { + eth_errno = -EINVAL; return -EINVAL; + } ret = eth_get_ops(dev)->start(dev); if (ret < 0)
eth_start_udev can fail but errno could still be zero which causes the function ignores the error silently. This fix catches the error properly. Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com> --- net/eth-uclass.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- base-commit: 3f19667468fb93bcb5702d23aa057b72639e3ac8 branch: main