diff --git a/sound/soc/msm/msm-cpe-lsm.c b/sound/soc/msm/msm-cpe-lsm.c index 2d431a018315..e6148c02c4eb 100644 --- a/sound/soc/msm/msm-cpe-lsm.c +++ b/sound/soc/msm/msm-cpe-lsm.c @@ -2647,12 +2647,15 @@ static int msm_cpe_lsm_ioctl_compat(struct snd_pcm_substream *substream, u_event_status32.payload_size; err = msm_cpe_lsm_ioctl_shared(substream, cmd, event_status); - if (err) + if (err) { dev_err(rtd->dev, "%s: %s failed, error = %d\n", __func__, "SNDRV_LSM_EVENT_STATUS_V3_32", err); + kfree(event_status); + goto done; + } } if (!err) {