Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2626873pxj; Mon, 31 May 2021 06:54:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvxU4VeSmy2tgLndS3F2XxvxKIOrCjwgbcDcnArmun4N2mCMsrH2yNiyhkZEgF4kHNYd8J X-Received: by 2002:a02:3ec8:: with SMTP id s191mr7394004jas.35.1622469248546; Mon, 31 May 2021 06:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622469248; cv=none; d=google.com; s=arc-20160816; b=wsgwtYbMijCDyY+KbNZMSCEgjQAEUE1kuJY0EF3YLfRwP3mj5LhAbpVH2dCAzCJuVG hdh916zopLrxyvlWhhiDizsPlyxo7HdJ+R+KLhRM/xz6HHe7nz25MQxg1BOgcU3r8N8k ixVDQqvqpkHoCucZBcDYAS+QiY2GB6j1jEaiOCB1tHhRQzFmzhoCG8MdL1kJNy0T+5Ea N07hQE7b0mOdwzdszRbe5AFeocn6tHNGh+I3iOLd6rpf0mnRloaGUlLXSTHRbNNvbzrT CT8HA3OQEZJ7/qvDQ3BWk6C1pDYQlzHlydzsc6ARHDzrNZX68crvbl6x04cTv0ti3bJQ 8gmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xA41mU8+Ar0+dzZxUWsE3fKmZIBtz5FGBBaZFpMOdvg=; b=MVKt010ZrshptRcledlRx/pPnBxtzrd+z8VX/xhs+gkXFgeumx0/WodpAh4e2xeD9D CelvW2kxifKg6SpvHfY147GIGLbQ0ouPEvYX9wTsJjG8nWj5aEC07BLXhaCFMp4Usj+x KoosdChnNWSlCXN85mrzcDMT+0H3PxPTMCej29VcuvyarRAoQ8gLC2xwv8Zx3yqCsqIM I2FPWTn++t0Sk3cH/o3bhxmkq0I2aOOXjf2EkVQ+Yg8ojQTafD3WclB7tWtEFHcoMW5q rxa8Z8s1ys5QvI01BjfuzC/Sc7d36+l3vK9vDBrsTTCfXhYx/Hv4DyGzdmucMhtkOqh6 UQcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iGvvlqNc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si14422565jat.42.2021.05.31.06.53.55; Mon, 31 May 2021 06:54:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iGvvlqNc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231261AbhEaNyE (ORCPT + 99 others); Mon, 31 May 2021 09:54:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:39238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232482AbhEaNfs (ORCPT ); Mon, 31 May 2021 09:35:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1FF2561448; Mon, 31 May 2021 13:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467531; bh=DbpjfWwOX5w4DXwVz2QROu43Vb5DxDjYUSn+itNusMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iGvvlqNcn6s/DZlxirqiOZL+6FRTBsKW8e3ChhkFdWRW4xFCv7/MZGuTthMK88tff xbA8QveuVsTnCsDm+NcE9tReiDyasORsiiCPH+uTnhJPgj10Ud3FDMNk0iBFLfms31 0UkLia+GGYCK6//s1I2QDRywJL0NAQKqp3BfI1zQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Russell King , Andrew Lunn , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 099/116] net: mdio: thunder: Fix a double free issue in the .remove function Date: Mon, 31 May 2021 15:14:35 +0200 Message-Id: <20210531130643.493455174@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130640.131924542@linuxfoundation.org> References: <20210531130640.131924542@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit a93a0a15876d2a077a3bc260b387d2457a051f24 ] 'bus->mii_bus' have been allocated with 'devm_mdiobus_alloc_size()' in the probe function. So it must not be freed explicitly or there will be a double free. Remove the incorrect 'mdiobus_free' in the remove function. Fixes: 379d7ac7ca31 ("phy: mdio-thunder: Add driver for Cavium Thunder SoC MDIO buses.") Signed-off-by: Christophe JAILLET Reviewed-by: Russell King Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/mdio-thunder.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/phy/mdio-thunder.c b/drivers/net/phy/mdio-thunder.c index 564616968cad..c0c922eff760 100644 --- a/drivers/net/phy/mdio-thunder.c +++ b/drivers/net/phy/mdio-thunder.c @@ -129,7 +129,6 @@ static void thunder_mdiobus_pci_remove(struct pci_dev *pdev) continue; mdiobus_unregister(bus->mii_bus); - mdiobus_free(bus->mii_bus); oct_mdio_writeq(0, bus->register_base + SMI_EN); } pci_set_drvdata(pdev, NULL); -- 2.30.2