[bug report] ASoC: rsnd: call missing snd_ctl_remove()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Kuninori Morimoto,

The patch d1f83d6ef43b: "ASoC: rsnd: call missing snd_ctl_remove()"
from Feb 2, 2015, leads to the following static checker warning:

	sound/soc/sh/rcar/core.c:1034 __rsnd_kctrl_new()
	error: double free of 'kctrl'

sound/soc/sh/rcar/core.c
  1026          int ret;
  1027  
  1028          kctrl = snd_ctl_new1(&knew, mod);
  1029          if (!kctrl)
  1030                  return -ENOMEM;
  1031  
  1032          ret = snd_ctl_add(card, kctrl);
  1033          if (ret < 0) {
  1034                  snd_ctl_free_one(kctrl);

The snd_ctl_add() function frees kctrl on error.  It's a confusing
layering violation IMHO but there are a lot of callers so I'm too lazy
to clean this up myself...

  1035                  return ret;
  1036          }
  1037  

regards,
dan carpenter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux