We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b760bb commit 8ddc056Copy full SHA for 8ddc056
sound/core/timer.c
@@ -294,8 +294,21 @@ int snd_timer_open(struct snd_timer_instance **ti,
294
get_device(&timer->card->card_dev);
295
timeri->slave_class = tid->dev_sclass;
296
timeri->slave_id = slave_id;
297
- if (list_empty(&timer->open_list_head) && timer->hw.open)
298
- timer->hw.open(timer);
+
+ if (list_empty(&timer->open_list_head) && timer->hw.open) {
299
+ int err = timer->hw.open(timer);
300
+ if (err) {
301
+ kfree(timeri->owner);
302
+ kfree(timeri);
303
304
+ if (timer->card)
305
+ put_device(&timer->card->card_dev);
306
+ module_put(timer->module);
307
+ mutex_unlock(®ister_mutex);
308
+ return err;
309
+ }
310
311
312
list_add_tail(&timeri->open_list, &timer->open_list_head);
313
snd_timer_check_master(timeri);
314
mutex_unlock(®ister_mutex);
0 commit comments