Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fcb8d05 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "bus: mhi_netdev: Free background memory pool during memory free"

parents 664adf1a b6f8fb3d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.*/
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.*/

#include <linux/module.h>
#include <linux/kernel.h>
@@ -411,6 +411,8 @@ static void mhi_netdev_free_pool(struct mhi_netdev *mhi_netdev)
		__free_pages(mhi_buf->page, mhi_netdev->order);
		mhi_netdev->bg_pool_size--;
	}

	kfree(mhi_netdev->bg_pool);
}

static int mhi_netdev_alloc_thread(void *data)
@@ -943,6 +945,7 @@ static void mhi_netdev_remove(struct mhi_device *mhi_dev)
	unregister_netdev(mhi_netdev->ndev);
	netif_napi_del(mhi_netdev->napi);
	free_netdev(mhi_netdev->ndev);
	mhi_netdev->ndev = NULL;

	if (!IS_ERR_OR_NULL(mhi_netdev->dentry))
		debugfs_remove_recursive(mhi_netdev->dentry);