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

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

Merge "ASoC: msm-lsm-client: free lsm client data in msm_lsm_close"

parents 4300ec47 0aed2b7e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ struct lsm_client {
	uint16_t	connect_to_port;
	uint8_t		num_confidence_levels;
	uint8_t		*confidence_levels;
	bool		opened;
	bool		started;
	dma_addr_t	lsm_cal_phy_addr;
	uint32_t	lsm_cal_size;
+7 −3
Original line number Diff line number Diff line
@@ -747,10 +747,9 @@ static int msm_lsm_ioctl_shared(struct snd_pcm_substream *substream,
			dev_err(rtd->dev,
				"%s: lsm open failed, %d\n",
				__func__, ret);
			q6lsm_client_free(prtd->lsm_client);
			kfree(prtd);
			return ret;
		}
		prtd->lsm_client->opened = true;
		dev_dbg(rtd->dev, "%s: Session_ID = %d, APP ID = %d\n",
			__func__,
			prtd->lsm_client->session,
@@ -1691,6 +1690,7 @@ static int msm_lsm_open(struct snd_pcm_substream *substream)
		runtime->private_data = NULL;
		return -ENOMEM;
	}
	prtd->lsm_client->opened = false;
	return 0;
}

@@ -1763,7 +1763,10 @@ static int msm_lsm_close(struct snd_pcm_substream *substream)
				 __func__);
	}

	if (prtd->lsm_client->opened) {
		q6lsm_close(prtd->lsm_client);
		prtd->lsm_client->opened = false;
	}
	q6lsm_client_free(prtd->lsm_client);

	spin_lock_irqsave(&prtd->event_lock, flags);
@@ -1771,6 +1774,7 @@ static int msm_lsm_close(struct snd_pcm_substream *substream)
	prtd->event_status = NULL;
	spin_unlock_irqrestore(&prtd->event_lock, flags);
	kfree(prtd);
	runtime->private_data = NULL;

	return 0;
}