Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp962495imm; Fri, 27 Jul 2018 08:59:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcg5W8SLdKccxn0HknetH6HR5B46j0cBJfwQh9pi2QHfHITxRy+QMhhNp5qQAQPMSJMzsAe X-Received: by 2002:a17:902:8306:: with SMTP id bd6-v6mr6674705plb.120.1532707176531; Fri, 27 Jul 2018 08:59:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532707176; cv=none; d=google.com; s=arc-20160816; b=PWMuZTmJVVpx9lO7RxWSrpNq7pqL0q+jkidccuz2nbfGG9BDIoLk4KYviUZMUxxuVx besPkWDACWHgFHxPeyeMZ1IByJrp4HOOThnJBzj7CJT23zICl5/lJljO1wehBULT/4jb Pvl9x9OdNl9b2Fwf681msRILXceLWWtJFqG0x+p3aH/qNiKCP6O0ggmr6nbhxqXJgaM1 FJR/GI6yqbm2ghLIUPMh4AQ38x5rWWjEICWg0d11vJD2cl5wQDTAfEFf78WWMxqQji6n 2DhJc76xt+4qXb4ACLO1C9IaBfX0GPKyC3MS5IB3RWm7CtIycL4CP0SqF6dBaS3MqSgi Cnpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8Z7mO0odEZmQGCP4YQvCbQxFKkNI/cL2mQCRgCryqUM=; b=xkdJaImf23gecgyvYpGnuxgHRLr9j7XlE647RZb54Y8EUcaUw5paGY1Ag2N0jAZlQ8 CaFh41tilJDlZhyaMe6d2a8/bD21BTJAT7m8nH8V+3IUbaM6fdT/dZVjchFaPHMvSU3h /4pro4zMPiSOOKnQh07xKbLgyyv6YLT9RIeVSzuV23ni7pTkt1N15lnrhl9uuhrhMV1X ZXgnILPNoizj1tB1sb9feZ7TJJjiWuEY9X0YzUkhGacDWBOw5O+9nw28SCrdTSLhISu3 +t1/leTwjCMxfaLmx2ix7gAoYBBFdrACJx1RMrYxC5m0OsVNGhYqTTBsz4KUGpSgIsJ1 m9ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i186-v6si4844528pfb.362.2018.07.27.08.59.21; Fri, 27 Jul 2018 08:59:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388827AbeG0RVG (ORCPT + 99 others); Fri, 27 Jul 2018 13:21:06 -0400 Received: from bran.ispras.ru ([83.149.199.196]:22920 "EHLO smtp.ispras.ru" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388571AbeG0RVF (ORCPT ); Fri, 27 Jul 2018 13:21:05 -0400 Received: from myklebust.intra.ispras.ru (unknown [10.10.2.207]) by smtp.ispras.ru (Postfix) with ESMTP id AB7AB203B2; Fri, 27 Jul 2018 18:58:30 +0300 (MSK) From: Anton Vasilyev To: Andrew Lunn Cc: Anton Vasilyev , Florian Fainelli , "David S. Miller" , Ray Jui , Scott Branden , Jon Mason , bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] net: mdio-mux: bcm-iproc: fix wrong getter and setter pair Date: Fri, 27 Jul 2018 18:57:47 +0300 Message-Id: <20180727155747.24978-1-vasilyev@ispras.ru> X-Mailer: git-send-email 2.18.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mdio_mux_iproc_probe() uses platform_set_drvdata() to store md pointer in device, whereas mdio_mux_iproc_remove() restores md pointer by dev_get_platdata(&pdev->dev). This leads to wrong resources release. The patch replaces getter to platform_get_drvdata. Signed-off-by: Anton Vasilyev --- drivers/net/phy/mdio-mux-bcm-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/mdio-mux-bcm-iproc.c b/drivers/net/phy/mdio-mux-bcm-iproc.c index 0831b7142df7..0c5b68e7da51 100644 --- a/drivers/net/phy/mdio-mux-bcm-iproc.c +++ b/drivers/net/phy/mdio-mux-bcm-iproc.c @@ -218,7 +218,7 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev) static int mdio_mux_iproc_remove(struct platform_device *pdev) { - struct iproc_mdiomux_desc *md = dev_get_platdata(&pdev->dev); + struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev); mdio_mux_uninit(md->mux_handle); mdiobus_unregister(md->mii_bus); -- 2.18.0