From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964880AbbJ0Otb (ORCPT ); Tue, 27 Oct 2015 10:49:31 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:38738 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932554AbbJ0OtZ (ORCPT ); Tue, 27 Oct 2015 10:49:25 -0400 From: Neil Armstrong Subject: [PATCH 6/6] net: phy: Stop 'phy-state-machine' and 'phy_change' work on remove To: "David S. Miller" Cc: Andrew Lunn , Florian Fainelli , Guenter Roeck , vivien.didelot@savoirfairelinux.com, Fabian Frederick , Pavel Nakonechny , Joe Perches , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Frode Isaksen Organization: Baylibre Message-ID: <562F8EF1.5090504@baylibre.com> Date: Tue, 27 Oct 2015 15:49:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoids: Unable to handle kernel NULL pointer dereference at virtual address 00000064 Workqueue: events_power_efficient phy_state_machine PC is at phy_state_machine+0x28/0x480 Signed-off-by: Frode Isaksen Signed-off-by: Neil Armstrong --- drivers/net/phy/phy_device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 3833891..b5b6c1b 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1348,6 +1348,12 @@ static int phy_remove(struct device *dev) phydev->state = PHY_DOWN; mutex_unlock(&phydev->lock); + cancel_delayed_work_sync(&phydev->state_queue); + flush_delayed_work(&phydev->state_queue); + + cancel_work_sync(&phydev->phy_queue); + flush_work(&phydev->phy_queue); + if (phydev->drv->remove) phydev->drv->remove(phydev); phydev->drv = NULL; -- 1.9.1