Re: [PATCH net] net: phy: dp83822: Fix null pointer access on DP83825/DP83826 devices

From: Simon Horman
Date: Thu Jan 26 2023 - 02:21:42 EST


On Wed, Jan 25, 2023 at 07:23:26PM +0100, Andre Kalb wrote:
> From: Andre Kalb <andre.kalb@xxxxxx>
>
> The probe() function is only used for the DP83822 PHY, leaving the
> private data pointer uninitialized for the smaller DP83825/26 models.
> While all uses of the private data structure are hidden in 82822 specific
> callbacks, configuring the interrupt is shared across all models.
> This causes a NULL pointer dereference on the smaller PHYs as it accesses
> the private data unchecked. Verifying the pointer avoids that.
>
> Fixes: 5dc39fd5ef35 ("net: phy: DP83822: Add ability to advertise Fiber connection")
> Signed-off-by: Andre Kalb <andre.kalb@xxxxxx>

Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>