Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* '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

+54 -34
+3 -2
sound/pci/ca0106/ca0106_main.c
··· 249 249 .name = "MSI K8N Diamond MB [SB0438]", 250 250 .gpio_type = 2, 251 251 .i2c_adc = 1 } , 252 - /* Another MSI K8N Diamond MB, which has apprently a different SSID */ 252 + /* MSI K8N Diamond PLUS MB */ 253 253 { .serial = 0x10091102, 254 254 .name = "MSI K8N Diamond MB", 255 255 .gpio_type = 2, 256 - .i2c_adc = 1 } , 256 + .i2c_adc = 1, 257 + .spi_dac = 2 } 257 258 /* Shuttle XPC SD31P which has an onboard Creative Labs 258 259 * Sound Blaster Live! 24-bit EAX 259 260 * high-definition 7.1 audio processor".
+7 -4
sound/soc/codecs/ak4535.c
··· 562 562 client_template.addr = addr; 563 563 564 564 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 565 - if (i2c == NULL) { 566 - kfree(codec); 565 + if (i2c == NULL) 567 566 return -ENOMEM; 568 - } 567 + 569 568 i2c_set_clientdata(i2c, codec); 570 569 codec->control_data = i2c; 571 570 ··· 582 583 return ret; 583 584 584 585 err: 585 - kfree(codec); 586 586 kfree(i2c); 587 587 return ret; 588 588 } ··· 658 660 #else 659 661 /* Add other interfaces here */ 660 662 #endif 663 + 664 + if (ret != 0) { 665 + kfree(codec->private_data); 666 + kfree(codec); 667 + } 661 668 return ret; 662 669 } 663 670
+7 -4
sound/soc/codecs/tlv320aic3x.c
··· 1199 1199 client_template.addr = addr; 1200 1200 1201 1201 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 1202 - if (i2c == NULL) { 1203 - kfree(codec); 1202 + if (i2c == NULL) 1204 1203 return -ENOMEM; 1205 - } 1204 + 1206 1205 i2c_set_clientdata(i2c, codec); 1207 1206 codec->control_data = i2c; 1208 1207 ··· 1220 1221 return ret; 1221 1222 1222 1223 err: 1223 - kfree(codec); 1224 1224 kfree(i2c); 1225 1225 return ret; 1226 1226 } ··· 1300 1302 #else 1301 1303 /* Add other interfaces here */ 1302 1304 #endif 1305 + 1306 + if (ret != 0) { 1307 + kfree(codec->private_data); 1308 + kfree(codec); 1309 + } 1303 1310 return ret; 1304 1311 } 1305 1312
+5 -4
sound/soc/codecs/uda1380.c
··· 729 729 client_template.addr = addr; 730 730 731 731 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 732 - if (i2c == NULL) { 733 - kfree(codec); 732 + if (i2c == NULL) 734 733 return -ENOMEM; 735 - } 734 + 736 735 i2c_set_clientdata(i2c, codec); 737 736 codec->control_data = i2c; 738 737 ··· 749 750 return ret; 750 751 751 752 err: 752 - kfree(codec); 753 753 kfree(i2c); 754 754 return ret; 755 755 } ··· 815 817 #else 816 818 /* Add other interfaces here */ 817 819 #endif 820 + 821 + if (ret != 0) 822 + kfree(codec); 818 823 return ret; 819 824 } 820 825
+5 -4
sound/soc/codecs/wm8510.c
··· 693 693 client_template.addr = addr; 694 694 695 695 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 696 - if (i2c == NULL) { 697 - kfree(codec); 696 + if (i2c == NULL) 698 697 return -ENOMEM; 699 - } 698 + 700 699 i2c_set_clientdata(i2c, codec); 701 700 codec->control_data = i2c; 702 701 ··· 713 714 return ret; 714 715 715 716 err: 716 - kfree(codec); 717 717 kfree(i2c); 718 718 return ret; 719 719 } ··· 780 782 #else 781 783 /* Add other interfaces here */ 782 784 #endif 785 + 786 + if (ret != 0) 787 + kfree(codec); 783 788 return ret; 784 789 } 785 790
+7 -4
sound/soc/codecs/wm8731.c
··· 596 596 client_template.addr = addr; 597 597 598 598 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 599 - if (i2c == NULL) { 600 - kfree(codec); 599 + if (i2c == NULL) 601 600 return -ENOMEM; 602 - } 601 + 603 602 i2c_set_clientdata(i2c, codec); 604 603 codec->control_data = i2c; 605 604 ··· 616 617 return ret; 617 618 618 619 err: 619 - kfree(codec); 620 620 kfree(i2c); 621 621 return ret; 622 622 } ··· 691 693 #else 692 694 /* Add other interfaces here */ 693 695 #endif 696 + 697 + if (ret != 0) { 698 + kfree(codec->private_data); 699 + kfree(codec); 700 + } 694 701 return ret; 695 702 } 696 703
+6 -4
sound/soc/codecs/wm8750.c
··· 869 869 client_template.addr = addr; 870 870 871 871 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 872 - if (i2c == NULL) { 873 - kfree(codec); 872 + if (i2c == NULL) 874 873 return -ENOMEM; 875 - } 874 + 876 875 i2c_set_clientdata(i2c, codec); 877 876 codec->control_data = i2c; 878 877 ··· 889 890 return ret; 890 891 891 892 err: 892 - kfree(codec); 893 893 kfree(i2c); 894 894 return ret; 895 895 } ··· 964 966 /* Add other interfaces here */ 965 967 #endif 966 968 969 + if (ret != 0) { 970 + kfree(codec->private_data); 971 + kfree(codec); 972 + } 967 973 return ret; 968 974 } 969 975
+7 -4
sound/soc/codecs/wm8753.c
··· 1660 1660 client_template.addr = addr; 1661 1661 1662 1662 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 1663 - if (!i2c) { 1664 - kfree(codec); 1663 + if (!i2c) 1665 1664 return -ENOMEM; 1666 - } 1665 + 1667 1666 i2c_set_clientdata(i2c, codec); 1668 1667 codec->control_data = i2c; 1669 1668 ··· 1681 1682 return ret; 1682 1683 1683 1684 err: 1684 - kfree(codec); 1685 1685 kfree(i2c); 1686 1686 return ret; 1687 1687 } ··· 1757 1759 #else 1758 1760 /* Add other interfaces here */ 1759 1761 #endif 1762 + 1763 + if (ret != 0) { 1764 + kfree(codec->private_data); 1765 + kfree(codec); 1766 + } 1760 1767 return ret; 1761 1768 } 1762 1769
+7 -4
sound/soc/codecs/wm8990.c
··· 1500 1500 client_template.addr = addr; 1501 1501 1502 1502 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 1503 - if (i2c == NULL) { 1504 - kfree(codec); 1503 + if (i2c == NULL) 1505 1504 return -ENOMEM; 1506 - } 1505 + 1507 1506 i2c_set_clientdata(i2c, codec); 1508 1507 codec->control_data = i2c; 1509 1508 ··· 1520 1521 return ret; 1521 1522 1522 1523 err: 1523 - kfree(codec); 1524 1524 kfree(i2c); 1525 1525 return ret; 1526 1526 } ··· 1593 1595 #else 1594 1596 /* Add other interfaces here */ 1595 1597 #endif 1598 + 1599 + if (ret != 0) { 1600 + kfree(codec->private_data); 1601 + kfree(codec); 1602 + } 1596 1603 return ret; 1597 1604 } 1598 1605