aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/ep93xx/ep93xx-i2s.c5
-rw-r--r--sound/soc/fsl/fsl_dma.c2
-rw-r--r--sound/soc/fsl/mpc8610_hpcd.c18
-rw-r--r--sound/soc/fsl/p1022_ds.c4
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c2
-rw-r--r--sound/soc/soc-core.c2
6 files changed, 19 insertions, 14 deletions
diff --git a/sound/soc/ep93xx/ep93xx-i2s.c b/sound/soc/ep93xx/ep93xx-i2s.c
index 56efa0c1c9a9..099614e16651 100644
--- a/sound/soc/ep93xx/ep93xx-i2s.c
+++ b/sound/soc/ep93xx/ep93xx-i2s.c
@@ -385,14 +385,14 @@ static int ep93xx_i2s_probe(struct platform_device *pdev)
385 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 385 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
386 if (!res) { 386 if (!res) {
387 err = -ENODEV; 387 err = -ENODEV;
388 goto fail; 388 goto fail_free_info;
389 } 389 }
390 390
391 info->mem = request_mem_region(res->start, resource_size(res), 391 info->mem = request_mem_region(res->start, resource_size(res),
392 pdev->name); 392 pdev->name);
393 if (!info->mem) { 393 if (!info->mem) {
394 err = -EBUSY; 394 err = -EBUSY;
395 goto fail; 395 goto fail_free_info;
396 } 396 }
397 397
398 info->regs = ioremap(info->mem->start, resource_size(info->mem)); 398 info->regs = ioremap(info->mem->start, resource_size(info->mem));
@@ -435,6 +435,7 @@ fail_unmap_mem:
435 iounmap(info->regs); 435 iounmap(info->regs);
436fail_release_mem: 436fail_release_mem:
437 release_mem_region(info->mem->start, resource_size(info->mem)); 437 release_mem_region(info->mem->start, resource_size(info->mem));
438fail_free_info:
438 kfree(info); 439 kfree(info);
439fail: 440fail:
440 return err; 441 return err;
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index 0efc04af8f15..ef15402a3bc4 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -878,10 +878,12 @@ static struct device_node *find_ssi_node(struct device_node *dma_channel_np)
878 * assume that device_node pointers are a valid comparison. 878 * assume that device_node pointers are a valid comparison.
879 */ 879 */
880 np = of_parse_phandle(ssi_np, "fsl,playback-dma", 0); 880 np = of_parse_phandle(ssi_np, "fsl,playback-dma", 0);
881 of_node_put(np);
881 if (np == dma_channel_np) 882 if (np == dma_channel_np)
882 return ssi_np; 883 return ssi_np;
883 884
884 np = of_parse_phandle(ssi_np, "fsl,capture-dma", 0); 885 np = of_parse_phandle(ssi_np, "fsl,capture-dma", 0);
886 of_node_put(np);
885 if (np == dma_channel_np) 887 if (np == dma_channel_np)
886 return ssi_np; 888 return ssi_np;
887 } 889 }
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c
index a19297959587..358f0baaf71b 100644
--- a/sound/soc/fsl/mpc8610_hpcd.c
+++ b/sound/soc/fsl/mpc8610_hpcd.c
@@ -345,8 +345,10 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
345 } 345 }
346 346
347 machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL); 347 machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL);
348 if (!machine_data) 348 if (!machine_data) {
349 return -ENOMEM; 349 ret = -ENOMEM;
350 goto error_alloc;
351 }
350 352
351 machine_data->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev); 353 machine_data->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev);
352 machine_data->dai[0].ops = &mpc8610_hpcd_ops; 354 machine_data->dai[0].ops = &mpc8610_hpcd_ops;
@@ -494,7 +496,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
494 ret = platform_device_add(sound_device); 496 ret = platform_device_add(sound_device);
495 if (ret) { 497 if (ret) {
496 dev_err(&pdev->dev, "platform device add failed\n"); 498 dev_err(&pdev->dev, "platform device add failed\n");
497 goto error; 499 goto error_sound;
498 } 500 }
499 dev_set_drvdata(&pdev->dev, sound_device); 501 dev_set_drvdata(&pdev->dev, sound_device);
500 502
@@ -502,14 +504,12 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
502 504
503 return 0; 505 return 0;
504 506
507error_sound:
508 platform_device_unregister(sound_device);
505error: 509error:
506 of_node_put(codec_np);
507
508 if (sound_device)
509 platform_device_unregister(sound_device);
510
511 kfree(machine_data); 510 kfree(machine_data);
512 511error_alloc:
512 of_node_put(codec_np);
513 return ret; 513 return ret;
514} 514}
515 515
diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c
index 8fa4d5f8eda1..fcb862eb0c73 100644
--- a/sound/soc/fsl/p1022_ds.c
+++ b/sound/soc/fsl/p1022_ds.c
@@ -297,8 +297,10 @@ static int get_dma_channel(struct device_node *ssi_np,
297 * dai->platform name should already point to an allocated buffer. 297 * dai->platform name should already point to an allocated buffer.
298 */ 298 */
299 ret = of_address_to_resource(dma_channel_np, 0, &res); 299 ret = of_address_to_resource(dma_channel_np, 0, &res);
300 if (ret) 300 if (ret) {
301 of_node_put(dma_channel_np);
301 return ret; 302 return ret;
303 }
302 snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%s", 304 snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%s",
303 (unsigned long long) res.start, dma_channel_np->name); 305 (unsigned long long) res.start, dma_channel_np->name);
304 306
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index a33fc51f363b..8f16cd37c2af 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -424,7 +424,7 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev)
424 if (!priv->mem) { 424 if (!priv->mem) {
425 dev_err(&pdev->dev, "request_mem_region failed\n"); 425 dev_err(&pdev->dev, "request_mem_region failed\n");
426 err = -EBUSY; 426 err = -EBUSY;
427 goto error; 427 goto error_alloc;
428 } 428 }
429 429
430 priv->io = ioremap(priv->mem->start, SZ_16K); 430 priv->io = ioremap(priv->mem->start, SZ_16K);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f8f985a4f2a8..fd173f6be18d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1915,7 +1915,7 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
1915 1915
1916 if (prefix) { 1916 if (prefix) {
1917 name_len = strlen(long_name) + strlen(prefix) + 2; 1917 name_len = strlen(long_name) + strlen(prefix) + 2;
1918 name = kmalloc(name_len, GFP_ATOMIC); 1918 name = kmalloc(name_len, GFP_KERNEL);
1919 if (!name) 1919 if (!name)
1920 return NULL; 1920 return NULL;
1921 1921