lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zald7u8B+uKzCn42@shell.armlinux.org.uk>
Date: Thu, 18 Jan 2024 17:20:46 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Andre Werner <andre.werner@...tec-electronic.com>
Cc: andrew@...n.ch, hkallweit1@...il.com, davem@...emloft.net,
	edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: phy: adin1100: Fix nullptr exception for phy
 interrupts

In addition to Andrew's comments:

On Thu, Jan 18, 2024 at 11:43:41AM +0100, Andre Werner wrote:
> +static int adin_config_intr(struct phy_device *phydev)
> +{
> +	int ret, regval;
> +
> +	ret = adin_phy_ack_intr(phydev);
> +
> +	if (ret)
> +		return ret;
> +
> +	regval = phy_read_mmd(phydev, MDIO_MMD_VEND2, ADIN_PHY_SUBSYS_IRQ_MASK);
> +	if (regval < 0)
> +		return regval;
> +
> +	if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
> +		regval |= ADIN_LINK_STAT_CHNG_IRQ_EN;
> +	else
> +		regval &= ~ADIN_LINK_STAT_CHNG_IRQ_EN;
> +
> +	ret = phy_write_mmd(phydev, MDIO_MMD_VEND2,
> +			    ADIN_PHY_SUBSYS_IRQ_MASK,
> +			    regval);
> +	return ret;

	u16 irq_mask;

	if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
		irq_mask = ADIN_LINK_STAT_CHNG_IRQ_EN;
	else
		irq_mask = 0;

	return phy_modify_mmd(phydev, MDIO_MMD_VEND2,
			      ADIN_PHY_SUBSYS_IRQ_MASK,
			      ADIN_LINK_STAT_CHNG_IRQ_EN, irq_mask);

> +}
> +
> +static irqreturn_t adin_phy_handle_interrupt(struct phy_device *phydev)
> +{
> +	int irq_status;
> +
> +	irq_status = phy_read_mmd(phydev, MDIO_MMD_VEND2, ADIN_PHY_SUBSYS_IRQ_STATUS);

Probably want to wrap this - if you're going to bother wrapping your
phy_write_mmd() above because it overflows 80 columns, then please do
so consistently.

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ