From: Johan Hovold Date: Tue, 17 Jun 2025 08:05:03 +0000 (+0200) Subject: phy: qcom: m31-eusb2: fix match data santity check X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=603bd9808f58009e1f230271f94e1b9e13d506ba;p=users%2Fjedix%2Flinux-maple.git phy: qcom: m31-eusb2: fix match data santity check The device_get_match_data() helper returns NULL if a new entry is ever added without corresponding match data. Fixes: 9c8504861cc4 ("phy: qcom: Add M31 based eUSB2 PHY driver") Cc: Wesley Cheng Cc: Melody Olvera Signed-off-by: Johan Hovold Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20250617080503.11262-1-johan+linaro@kernel.org Signed-off-by: Vinod Koul --- diff --git a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c index 7b7120e4214f0..520eabcc61f71 100644 --- a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c +++ b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c @@ -253,7 +253,7 @@ static int m31eusb2_phy_probe(struct platform_device *pdev) return -ENOMEM; data = device_get_match_data(dev); - if (IS_ERR(data)) + if (!data) return -EINVAL; phy->data = data;