]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 25 Aug 2008 18:24:51 +0000 (11:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 25 Aug 2008 18:24:51 +0000 (11:24 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: ASoC: Fix double free and memory leak in many codec drivers
  ALSA: CA0106 on MSI K8N Diamond PLUS Motherboard

1  2 
sound/soc/codecs/wm8753.c

index dc7b18fd278206ae0947796420adf4eb58a44c6f,35bf1c369870ccc79f1d43636b35a740434db5a8..5761164fe16dea17481b538f4734d66fafdbebe9
@@@ -34,6 -34,7 +34,6 @@@
  
  #include <linux/module.h>
  #include <linux/moduleparam.h>
 -#include <linux/version.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/delay.h>
@@@ -1660,10 -1661,9 +1660,9 @@@ static int wm8753_codec_probe(struct i2
        client_template.addr = addr;
  
        i2c =  kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
-       if (!i2c) {
-               kfree(codec);
+       if (!i2c)
                return -ENOMEM;
-       }
        i2c_set_clientdata(i2c, codec);
        codec->control_data = i2c;
  
        return ret;
  
  err:
-       kfree(codec);
        kfree(i2c);
        return ret;
  }
@@@ -1759,6 -1758,11 +1757,11 @@@ static int wm8753_probe(struct platform
  #else
                /* Add other interfaces here */
  #endif
+       if (ret != 0) {
+               kfree(codec->private_data);
+               kfree(codec);
+       }
        return ret;
  }