Article View: linux.kernel.netdev
Article #5150Re: [PATCH net v2] net: usb: lan78xx: avoid NULL PHY dereference in WoL setup
From: Andrew Lunn
Date: Mon, 19 Oct 2026 21:24
Date: Mon, 19 Oct 2026 21:24
19 lines
8680 bytes
8680 bytes
> @@ -1805,7 +1805,9 @@ static int lan78xx_set_wol(struct net_device *netdev, > if (ret < 0) > goto exit_pm_put; > > - ret = phy_ethtool_set_wol(netdev->phydev, wol); > + if (phylink_expects_phy(dev->phylink)) Is phylink_expects_phy() actually needed? > + ret = phylink_ethtool_set_wol(dev->phylink, wol); We try to keep the phylink API simple, and put all the complexity within phylink. Hence it would be better if you could just call phylink_ethtool_set_wol() and at the MAC level not have to care about fixed link. phylink knows if there is a PHY, it should decide what to do. Andrew
Technical Details
Message-ID:
<d9177176-75c2-4273-b5ba-d0c6afdad6c5@lunn.ch>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348852-linux-kernel-netdev=dewy.ruReferences:
<20261019193148.1381545-1-prashantsengar25031@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348852-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v2] net: usb: lan78xx: avoid NULL PHY dereference in WoL setup Date: Mon, 19 Oct 2026 23:24:14 +0200 Organization: Usenet Network Message-ID: <d9177176-75c2-4273-b5ba-d0c6afdad6c5@lunn.ch> References: <20261019193148.1381545-1-prashantsengar25031@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="3716102"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:6C5m4rGi9Mip5srUXv7b1OxVlg8= sha256:RV9sih3uneYO0SO+5MGEv1fpwQRfkpwXjFb4KHV0bz8= sha1:M7Zo9w/159B7OEqCEUywHOyHM7o= sha256:0Ijna6WJMssDmalOpCrf/MPoY/qWtg1GsTPYXaxQHWU= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id DB69D110B3F; Tue, 20 Oct 2026 00:26:25 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XGzQXHiAiFrC; Tue, 20 Oct 2026 00:26:23 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-348852-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 82D0D110B29; Tue, 20 Oct 2026 00:26:12 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 4A0373DA6E; Mon, 19 Oct 2026 21:24:20 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792445059; b=tZplUsYbyths8e8j/Mk6nyShiyrsRw8JAj5LX716Lg2RH4J30C/ErxN+WGOFUKX636wD jiJlxYDqCOdkDJ7Yh6T2CBGgHplszNLuHj0mn+U2aaz5kmgJGyMGpMG2kffqESeG8sn/C 2X8OGk3cM5ENhL3Ath1jYjdAU2nqi2Z5xMKx28UaMIuxUTk8g9BM/1a6S3XksUqjGWEWu m590G3J+oaY7ptlJKmbZHag4rSHMIe0w6GaKp2AFAvLHxoUBjtD49LhAH8V2c964v/gdY +VG2NBLu9aLR3DSXpu93yp/oqQcaqNnnWksOFINVhqmcg2xtqEkeglfDfTluvfmrnyQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792445059; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=1YXs6rrJZv6Usz6XsrtQKINxbiM6rWZ3xRR58cYtHN0=; b=AhpWvujh1HRhetcY1ZDcJF203F9M3vBJUPBaufiqmYhU9+LAHCkpNI0oBa+OHIYJJlHG D/9m3NxvdvHGgy4GbmFFfQDO47g8NkUJaWN+FRgT/NBdh/SonV9mjgCb1L/SI84oVT+2q InXjT/KeFgrJAfAK69jpELBZ5qtZHL0hhyJEmTxOWVtiyrn72qE+S9rC0GxFe3VH9PE8+ w0dv/DqEgVKieGhE4xMVCsdf6ejSs+JvCvwYBSIqaXAggjr+JO5FFTYAvhRM88o39wmF8 GAlsn9CkJ0svb3hb74go8kJ/vPY4+BBeE0L8qLmu/V1EFq+QFbs5EYsDu4jH8qUf1lQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=SDLR9a8l; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 190E3606A327; Mon, 19 Oct 2026 21:24:19 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=SDLR9a8l X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792445058; b=gsRkFarLHqzVt4J+gbaAMzwWTVCdizUOQk0PSdpMY7ecs9ai5XjbWdE51G0ss/QQE9HC DidBuPUDyEVSUysEuSUGSeefq+SjuO9NMtaiGZ8bOh0yg6LPA31oPf55pey/i/qrxPkKp 2+qupLmFph230C0Gen6vuT9FMl0smYR95YTfWL+7xHWeDPAyFxB4oMosiz6Top88/Nxhi vFqmUs3Tyc2Hke6fF27/brFMzWosGtmSdyVxZS7YiVPl1xSYwoMQxAtJ5g+86BtiIC0kQ TlpOwOkEOxF2OtmfyS5RcTcCmsd/lJ3C3LPcMRGXA/N0pciJ8uhCgY96jsZHgjtqU5Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792445058; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=1YXs6rrJZv6Usz6XsrtQKINxbiM6rWZ3xRR58cYtHN0=; b=ew7oYesFWySryqopaEXzoZ/rRtj6BFuJ2hbraNpRHEmpZdd3HDpHtET0yL376EVM5tVn 54c9l1lqGs5LLiRpgsLuZSzU1evtLNxem50PtL8lUOKZ40BAneqiyw/WfSBNWvI18YSDL hJ515tp6+vRH1q+S0xXNFkh7ywKKqUeDzd+emmQaGfc7dkl/FLJjgcOuxnPxDdq+6fiBz ElJCcbJeAuXW5XgFHqywLsCBCAgGBHPXD8ycq5ChHYzCJs41WXYisLI1NJ9czwIuFTzb9 Hy07bhaQXOO7xVdP0WLkMNgwsxScVbm3JWou4Uz/pzKx0Eab/CBT6mGLinUbfjxMm1g== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=SDLR9a8l; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C43AC606A319; Mon, 19 Oct 2026 21:24:17 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C43AC606A319 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=1YXs6rrJZv6Usz6XsrtQKINxbiM6rWZ3xRR58cYtHN0=; b=SDLR9a8lBKfpRccuCc5ld0BsJn 9uCmTFKQYrlloKxuSKSPg7w00B7M64mutjTo45+3XNOMC8ikGdM7PCqSsm/QeCwQ/KR+AZBYOrE41 Bm6VyUqlckHXiM3bV53xvhs+EsMsMcQ6Qy1ksIIk0Zqi/qcg0iZA/mFY1tSS5LxlUlOg=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xIuq6-00Bi8x-7G; Mon, 19 Oct 2026 23:24:14 +0200 X-Cc: netdev@vger.kernel.org, Thangaraj.S@microchip.com, UNGLinuxDriver@microchip.com, andrew+netdev@lunn.ch, linux-usb@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261019193148.1381545-1-prashantsengar25031@gmail.com>