23 Dec
2015
23 Dec
'15
1:14 a.m.
On Tue, Dec 15, 2015 at 11:29:45AM +0000, Charles Keepax wrote:
+int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream) +{
- struct wm_adsp_compr *compr;
- int ret = 0;
- mutex_lock(&dsp->pwr_lock);
- if (wm_adsp_fw[dsp->fw].num_caps == 0) {
adsp_err(dsp, "Firmware does not support compressed API\n");
ret = -ENXIO;
goto out;
- }
- if (wm_adsp_fw[dsp->fw].compr_direction != stream->direction) {
adsp_err(dsp, "Firmware does not support stream direction\n");
ret = -EINVAL;
goto out;
- }
- compr = kzalloc(sizeof(*compr), GFP_KERNEL);
You're doing this under lock but not checking for an attempt to allocate on a DSP already in use.