From patchwork Mon May 18 17:35:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 225677 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 422F3C433DF for ; Mon, 18 May 2020 18:14:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EFB720671 for ; Mon, 18 May 2020 18:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589825693; bh=OePKM7A1K0XYiRWplDYUiamyPrsd/Yopn1WWNiCHw9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ERpIubh/nreldJsg0b0NX4orNzOEFjMSF823FXvVHNopyWYNdgYLFAOiXRMQVnItD nqNkFwMTPU37BJ/d8iHhsNdubRzdg9oRXMKxtOmJpXgrA3ZQ5p//CigU4FUwA3kXh9 RMYxH4svphoEbHLwM680YDHgCDmAkyzXJmAmkKE4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732193AbgERSAS (ORCPT ); Mon, 18 May 2020 14:00:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:41522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731731AbgERSAR (ORCPT ); Mon, 18 May 2020 14:00:17 -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 52D7D20715; Mon, 18 May 2020 18:00:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589824816; bh=OePKM7A1K0XYiRWplDYUiamyPrsd/Yopn1WWNiCHw9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ADej+w4kNGOS1K2KODuD0Eg4jXPtlsZzCvbWJyctzVgncrTK4DZWj1jn+uufwdMsA UCCdKAWBJaoj6L6sIzIX+3li9jFbYsbyatVrJgBBUu52WTSTGPnagsdj0pWL35/OU+ YdRDQyJbwNHYxnncRuZhPG0C92oRcpO5B5xZEIrc= 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 5.6 016/194] net: moxa: Fix a potential double free_irq() Date: Mon, 18 May 2020 19:35:06 +0200 Message-Id: <20200518173532.946293614@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173531.455604187@linuxfoundation.org> References: <20200518173531.455604187@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 e1651756bf9da..f70bb81e1ed65 100644 --- a/drivers/net/ethernet/moxa/moxart_ether.c +++ b/drivers/net/ethernet/moxa/moxart_ether.c @@ -564,7 +564,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);