From patchwork Mon May 18 17:36:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225564 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D6D1C433E1 for ; Mon, 18 May 2020 18:28:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB26A20657 for ; Mon, 18 May 2020 18:28:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589826481; bh=WdLbPh1jVdQM0eslIz62960jia9I6v4aRFvUL1SGIvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VzgNksu1SEuZpIypLyfj/d1EMxrypOApXOpm3iozhCE1XvSVe9aut2AUXd0H3aC1E pVsUeXtmQl8QSOzXTT6rqp8QPiVat6wmgImqcwJwnE+ESFmnzUnHKGpa7BPsE42xew sy+Gz02bx2xqAOhoTSoG7+1jvMhQHOX8CmooWPE0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728793AbgERS14 (ORCPT ); Mon, 18 May 2020 14:27:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:41042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729576AbgERRn0 (ORCPT ); Mon, 18 May 2020 13:43:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B4D7320657; Mon, 18 May 2020 17:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589823806; bh=WdLbPh1jVdQM0eslIz62960jia9I6v4aRFvUL1SGIvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a/8xBhhhxTE0JOz41GxIEzYHvZGXsEMgOkj6rgFlNsz/AdCS2BZHNbvweZKNvJ9eu tq7240sr1uBmzp7e0H94ToHCgyibz5JN0Y6SOibsDePw4LyQ2c0PqAxGRgLgRBEyXV T1suOf5TV0KIo0ovmBFAbqVF+UM1IC8O1aK7W0DI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 43/90] net: moxa: Fix a potential double free_irq() Date: Mon, 18 May 2020 19:36:21 +0200 Message-Id: <20200518173500.040306716@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173450.930655662@linuxfoundation.org> References: <20200518173450.930655662@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christophe JAILLET [ Upstream commit ee8d2267f0e39a1bfd95532da3a6405004114b27 ] Should an irq requested with 'devm_request_irq' be released explicitly, it should be done by 'devm_free_irq()', not 'free_irq()'. Fixes: 6c821bd9edc9 ("net: Add MOXA ART SoCs ethernet driver") Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/moxa/moxart_ether.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c index 0622fd03941b8..6fe61d9343cb8 100644 --- a/drivers/net/ethernet/moxa/moxart_ether.c +++ b/drivers/net/ethernet/moxa/moxart_ether.c @@ -571,7 +571,7 @@ static int moxart_remove(struct platform_device *pdev) struct net_device *ndev = platform_get_drvdata(pdev); unregister_netdev(ndev); - free_irq(ndev->irq, ndev); + devm_free_irq(&pdev->dev, ndev->irq, ndev); moxart_mac_free_memory(ndev); free_netdev(ndev);