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

Commit 27bb68c6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mhi_dev: Do not free channel memory in mhi_deinit"

parents 92d44bbb ad598877
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -1984,6 +1984,8 @@ int mhi_dev_channel_isempty(struct mhi_dev_client *handle)
	int rc;

	ch = handle->channel;
	if (!ch)
		return -EINVAL;

	rc = ch->ring->rd_offset == ch->ring->wr_offset;

@@ -2749,11 +2751,7 @@ static int mhi_deinit(struct mhi_dev *mhi)
			ring->ring_cache_dma_handle);
	}

	for (i = 0; i < mhi->cfg.channels; i++)
		mutex_destroy(&mhi->ch[i].ch_lock);

	devm_kfree(&pdev->dev, mhi->mmio_backup);
	devm_kfree(&pdev->dev, mhi->ch);
	devm_kfree(&pdev->dev, mhi->ring);

	mhi_dev_sm_exit(mhi);
@@ -2781,6 +2779,11 @@ static int mhi_init(struct mhi_dev *mhi)
	if (!mhi->ring)
		return -ENOMEM;

	/*
	 * mhi_init is also called during device reset, in
	 * which case channel mem will already be allocated.
	 */
	if (!mhi->ch) {
		mhi->ch = devm_kzalloc(&pdev->dev,
			(sizeof(struct mhi_dev_channel) *
			(mhi->cfg.channels)), GFP_KERNEL);
@@ -2789,6 +2792,7 @@ static int mhi_init(struct mhi_dev *mhi)

		for (i = 0; i < mhi->cfg.channels; i++)
			mutex_init(&mhi->ch[i].ch_lock);
	}

	spin_lock_init(&mhi->lock);
	mhi->mmio_backup = devm_kzalloc(&pdev->dev,