From patchwork Wed May 4 14:31:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 12838006 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7717C433FE for ; Wed, 4 May 2022 14:31:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351351AbiEDOfJ (ORCPT ); Wed, 4 May 2022 10:35:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351347AbiEDOfG (ORCPT ); Wed, 4 May 2022 10:35:06 -0400 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F7F540A39; Wed, 4 May 2022 07:31:31 -0700 (PDT) Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-e93bbb54f9so1321531fac.12; Wed, 04 May 2022 07:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mR7qVUfY5UjZOEcxyx4x5ViEVp0uC0ZkWAsTwVzhVD0=; b=M6uxTD4Ut2Gn0n+p+mO/qkPMcYQ5HveKQrHNVxJYYEzNZkCXif/8QzKLzhbGcwYMnU t0Oc3ar/Jtop0kxJPJi3KmQhDXLpKGlhNF1PKt7w7w4P8m6m+jfPucdUriQQdw7wi9Bl l34TXiMvC511gYXaYNNPzGJmfxDJblFZXvJ/ioCeulZFRwi76XNqyEMrs2wD5s3fYd4S 6zfaEXEuK2PCvSKs4R77mqx+Z1fRyOGXd/bvXdBWVuLr47SXIK7D/5iZWLH9KRHeffXc tmcY50wl/7vgWTom1JBwhGhUXcAkxY0sD0/Mr81Gc1l7LJnumFS9VNOpYXCEV3oQjZYr s5Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mR7qVUfY5UjZOEcxyx4x5ViEVp0uC0ZkWAsTwVzhVD0=; b=TYtG/RohLRcx+X0IcN8yB+NQGAZLCI9KblSTLpnDxByHsS8gRKObLVbK2zyP6TDiDi 81r4hWSDxEN1AsXaolVe/rhiO6vlgz+V3yb550uCzCxDlmQ7SKe61Zws0Cc2c0cq6jkh AN1W2skZsxnigW+1DG4dd4cAZGEQc7MlM2uDdbU7EaMbezd5ZI3BKsn0JfnjiSeKRT60 IctBOO71dKzGWU6D0+DhYq9D/F3COZOuKMpXwRXHslA5bJz6QQssOvZmJX+X15yE4wS3 0L7xQYAuryNiyP9TwiMwGwBAptkjStN+6mxU5en1jWlsyFJUCLJuswVt/lRmTtvIsdie ZpBA== X-Gm-Message-State: AOAM531CySYW9s+D2zH647c7PR5gfV+c15WleOmA147XKNKyYPyVHuRo 0reaMa1nfVC4k0C2thNJBZo= X-Google-Smtp-Source: ABdhPJzmU6cDgEmnlcwzS0PHeU93YvCjTHg61HiF2Ay4p+5NaThOcIz6V73agA43KtkepBmLhrRO5g== X-Received: by 2002:a05:6870:340e:b0:ec:c40f:e630 with SMTP id g14-20020a056870340e00b000ecc40fe630mr3736963oah.144.1651674690955; Wed, 04 May 2022 07:31:30 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:485:4b69:6ef3:840d:df28:4651]) by smtp.gmail.com with ESMTPSA id m9-20020a4ad509000000b0035eb4e5a6dasm6018832oos.48.2022.05.04.07.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 07:31:30 -0700 (PDT) From: Fabio Estevam To: kuba@kernel.org Cc: davem@davemloft.net, andrew@lunn.ch, claudiu.beznea@microchip.com, netdev@vger.kernel.org, o.rempel@pengutronix.de, linux@armlinux.org.uk, Fabio Estevam , stable@vger.kernel.org Subject: [PATCH net v2 2/2] net: phy: micrel: Pass .probe for KS8737 Date: Wed, 4 May 2022 11:31:04 -0300 Message-Id: <20220504143104.1286960-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504143104.1286960-1-festevam@gmail.com> References: <20220504143104.1286960-1-festevam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Fabio Estevam Since commit f1131b9c23fb ("net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices") the kszphy_suspend/ resume hooks are used. These functions require the probe function to be called so that priv can be allocated. Otherwise, a NULL pointer dereference happens inside kszphy_config_reset(). Cc: stable@vger.kernel.org Fixes: f1131b9c23fb ("net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices") Reported-by: Andrew Lunn Signed-off-by: Fabio Estevam Reviewed-by: Andrew Lunn --- Changes since v1: - Newly introduced. This was noticed by Andrew. drivers/net/phy/micrel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 11cd073630e5..a06661c07ca8 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -2896,6 +2896,7 @@ static struct phy_driver ksphy_driver[] = { .name = "Micrel KS8737", /* PHY_BASIC_FEATURES */ .driver_data = &ks8737_type, + .probe = kszphy_probe, .config_init = kszphy_config_init, .config_intr = kszphy_config_intr, .handle_interrupt = kszphy_handle_interrupt,