Skip to content

Commit b1fbebd

Browse files
takaswietiwai
authored andcommitted
ALSA: bebob: fix memory leak for M-Audio FW1814 and ProjectMix I/O at error path
After allocating model-dependent data for M-Audio FW1814 and ProjectMix I/O, ALSA bebob driver has memory leak at error path. This commit releases the allocated data at the error path. Fixes: 04a2c73('ALSA: bebob: delayed registration of sound card') Cc: <[email protected]> # v4.7+ Signed-off-by: Takashi Sakamoto <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 37a3a98 commit b1fbebd

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

sound/firewire/bebob/bebob.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ do_registration(struct work_struct *work)
263263
error:
264264
mutex_unlock(&devices_mutex);
265265
snd_bebob_stream_destroy_duplex(bebob);
266+
kfree(bebob->maudio_special_quirk);
267+
bebob->maudio_special_quirk = NULL;
266268
snd_card_free(bebob->card);
267269
dev_info(&bebob->unit->device,
268270
"Sound card registration failed: %d\n", err);

sound/firewire/bebob/bebob_maudio.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,6 @@ snd_bebob_maudio_special_discover(struct snd_bebob *bebob, bool is1814)
294294
bebob->midi_output_ports = 2;
295295
}
296296
end:
297-
if (err < 0) {
298-
kfree(params);
299-
bebob->maudio_special_quirk = NULL;
300-
}
301297
mutex_unlock(&bebob->mutex);
302298
return err;
303299
}

0 commit comments

Comments
 (0)