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

Commit fc22a3ea authored by Bhaumik Bhatt's avatar Bhaumik Bhatt Committed by Gerrit - the friendly Code Review server
Browse files

bus: mhi_netdev: Free background memory pool during memory free



Fix freeing the background memory pool to avoid kmemleak as
part of freeing the memory pool.

Change-Id: I29c9d972295900bd0b97c8ab8ee73d668e05a59f
Signed-off-by: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
parent 96cd1812
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);