🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #4596

Re: [PATCH net] net: usb: lan78xx: avoid NULL PHY dereference in WoL setup

#4596
From: Andrew Lunn
Date: Sun, 18 Oct 2026 16:21
15 lines
6094 bytes
On Sun, Oct 18, 2026 at 08:48:30PM +0530, Prashant Sengar wrote:
> LAN7801 supports fixed-link configurations without an attached PHY.
> However, lan78xx_set_wol() unconditionally passes netdev->phydev
> to phy_ethtool_set_wol(), which dereferences the missing PHY.
> 
> Only call the PHY Wake-on-LAN helper when a PHY is attached.

A MAC driver using phylink_ should not call any phy_ methods
directly. It should always go via the phylink API.

    Andrew

---
pw-bot: cr
Technical Details
Message-ID: <b050adae-97b7-4f9a-93cc-5f2f96bf6e3e@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-348092-linux-kernel-netdev=dewy.ru
References: <20261018151830.643511-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-348092-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net: usb: lan78xx: avoid NULL PHY dereference in WoL
 setup
Date: Sun, 18 Oct 2026 18:21:34 +0200
Organization: Usenet Network
Message-ID: <b050adae-97b7-4f9a-93cc-5f2f96bf6e3e@lunn.ch>
References: <20261018151830.643511-1-prashantsengar25031@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="3368812"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:EXulAKY1Nah9Vsl/LRl/4lcOu98= sha256:ut/J9suyYAlVBfZO+n0UPAWWQTv+qUOUEpSehlksI0o=
	sha1:MXCvVAOdELag23dxBcFrvPI+LM8= sha256:LwXoZUvhCYN30Wha8GgqUmo4ncPZFnsNmYB3VDLqKUY=
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 3F270110845; Sun, 18 Oct 2026 19:22:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.95
X-Spam-Status: No, score=-1.95 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=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 PkwyOaO8OTpI;
	Sun, 18 Oct 2026 19:22:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-348092-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 16D82110843; Sun, 18 Oct 2026 19:22:16 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id 6177C3792A; Sun, 18 Oct 2026 16:21:40 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A6B04D0CE9;
	Sun, 18 Oct 2026 16:21:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Q4O6S0V/"
X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBE934CE692;
	Sun, 18 Oct 2026 16:21:37 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792340499; cv=none; b=kzmBkUatiMnm9JvbnDtZEzuc5D4eI/qo+q5Y5sgUN6ZkatGM7UocpIfMHbJRAn+b7e8g/Is+qwfGUFpGoQuxqlHot4s86Zb8yzz6I3OnHtGxlpbGI1lDnRr6jCXrpciujQzXVxyddtT5yxKYjKgaEH9YaWCt7q/1rzAWwxdyCbo=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792340499; c=relaxed/simple;
	bh=+UOjlPgqb3SZD7ckwUWzkOrBkVrEnmv/NXmIn6PJ0zA=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=DIM/Gi2mtGJgkT/TkEDv1YFJ0dlmyPGudrcoUi7hODSlxvGCLPX+Nouqjf7Dw9k6XzBkSS8LduY+E4ZlOvWPXr+OLBMMS7z/+k6Gpdy7rSFLNMKGemx/Cu51E3c5/hWfsQHu8EA4klXSlFayLMtKpJPCVkccA92mbqYPivQt9RM=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=Q4O6S0V/; arc=none smtp.client-ip=156.67.10.101
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=tNJS13q0fNrC6U0K+swsjrGdIQaNvIk1vQAXLrc1VAw=; b=Q4O6S0V/oDLKB3dfh9DiL7s3K+
	oKjGmRJYu/8NhnpPb3RDqlT0Z0Fb2+W7Yqz1/58s5Y0F14W7dLRB2IstOW1lCzj/RqxxLoJq6zmk1
	Vw84q40pcZvW8txVGXN4hcByELw9rfDJI/w/Jnu8hU6z7QMdltzFx+pe/jD3f8cxC9bs=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xITde-00BVXR-Gr; Sun, 18 Oct 2026 18:21:34 +0200
X-Cc: netdev@vger.kernel.org, Thangaraj.S@microchip.com,
	UNGLinuxDriver@microchip.com, linux-usb@vger.kernel.org
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <20261018151830.643511-1-prashantsengar25031@gmail.com>