Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"This became an unexpectedly large pull request due to various
regression fixes in the previous kernels.

The majority of fixes are a series of patches to address the
regression at probe errors in devres'ed drivers, while there are yet
more fixes for the x86 SG allocations and for USB-audio buffer
management. In addition, a few HD-audio quirks and other small fixes
are found"

* tag 'sound-5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (52 commits)
ALSA: usb-audio: Limit max buffer and period sizes per time
ALSA: memalloc: Add fallback SG-buffer allocations for x86
ALSA: nm256: Don't call card private_free at probe error path
ALSA: mtpav: Don't call card private_free at probe error path
ALSA: rme9652: Fix the missing snd_card_free() call at probe error
ALSA: hdspm: Fix the missing snd_card_free() call at probe error
ALSA: hdsp: Fix the missing snd_card_free() call at probe error
ALSA: oxygen: Fix the missing snd_card_free() call at probe error
ALSA: lx6464es: Fix the missing snd_card_free() call at probe error
ALSA: cmipci: Fix the missing snd_card_free() call at probe error
ALSA: aw2: Fix the missing snd_card_free() call at probe error
ALSA: als300: Fix the missing snd_card_free() call at probe error
ALSA: lola: Fix the missing snd_card_free() call at probe error
ALSA: bt87x: Fix the missing snd_card_free() call at probe error
ALSA: sis7019: Fix the missing error handling
ALSA: intel_hdmi: Fix the missing snd_card_free() call at probe error
ALSA: via82xx: Fix the missing snd_card_free() call at probe error
ALSA: sonicvibes: Fix the missing snd_card_free() call at probe error
ALSA: rme96: Fix the missing snd_card_free() call at probe error
ALSA: rme32: Fix the missing snd_card_free() call at probe error
...

+508 -126
+1
include/sound/core.h
··· 284 284 void snd_card_disconnect_sync(struct snd_card *card); 285 285 int snd_card_free(struct snd_card *card); 286 286 int snd_card_free_when_closed(struct snd_card *card); 287 + int snd_card_free_on_error(struct device *dev, int ret); 287 288 void snd_card_set_id(struct snd_card *card, const char *id); 288 289 int snd_card_register(struct snd_card *card); 289 290 int snd_card_info_init(void);
+5
include/sound/memalloc.h
··· 51 51 #define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV /* no SG-buf support */ 52 52 #define SNDRV_DMA_TYPE_DEV_WC_SG SNDRV_DMA_TYPE_DEV_WC 53 53 #endif 54 + /* fallback types, don't use those directly */ 55 + #ifdef CONFIG_SND_DMA_SGBUF 56 + #define SNDRV_DMA_TYPE_DEV_SG_FALLBACK 10 57 + #define SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK 11 58 + #endif 54 59 55 60 /* 56 61 * info for buffer allocation
+28
sound/core/init.c
··· 209 209 * snd_card_register(), the very first devres action to call snd_card_free() 210 210 * is added automatically. In that way, the resource disconnection is assured 211 211 * at first, then released in the expected order. 212 + * 213 + * If an error happens at the probe before snd_card_register() is called and 214 + * there have been other devres resources, you'd need to free the card manually 215 + * via snd_card_free() call in the error; otherwise it may lead to UAF due to 216 + * devres call orders. You can use snd_card_free_on_error() helper for 217 + * handling it more easily. 212 218 */ 213 219 int snd_devm_card_new(struct device *parent, int idx, const char *xid, 214 220 struct module *module, size_t extra_size, ··· 240 234 return 0; 241 235 } 242 236 EXPORT_SYMBOL_GPL(snd_devm_card_new); 237 + 238 + /** 239 + * snd_card_free_on_error - a small helper for handling devm probe errors 240 + * @dev: the managed device object 241 + * @ret: the return code from the probe callback 242 + * 243 + * This function handles the explicit snd_card_free() call at the error from 244 + * the probe callback. It's just a small helper for simplifying the error 245 + * handling with the managed devices. 246 + */ 247 + int snd_card_free_on_error(struct device *dev, int ret) 248 + { 249 + struct snd_card *card; 250 + 251 + if (!ret) 252 + return 0; 253 + card = devres_find(dev, __snd_card_release, NULL, NULL); 254 + if (card) 255 + snd_card_free(card); 256 + return ret; 257 + } 258 + EXPORT_SYMBOL_GPL(snd_card_free_on_error); 243 259 244 260 static int snd_card_init(struct snd_card *card, struct device *parent, 245 261 int idx, const char *xid, struct module *module,
+110 -1
sound/core/memalloc.c
··· 499 499 }; 500 500 #endif /* CONFIG_X86 */ 501 501 502 + #ifdef CONFIG_SND_DMA_SGBUF 503 + static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size); 504 + #endif 505 + 502 506 /* 503 507 * Non-contiguous pages allocator 504 508 */ ··· 513 509 514 510 sgt = dma_alloc_noncontiguous(dmab->dev.dev, size, dmab->dev.dir, 515 511 DEFAULT_GFP, 0); 516 - if (!sgt) 512 + if (!sgt) { 513 + #ifdef CONFIG_SND_DMA_SGBUF 514 + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG) 515 + dmab->dev.type = SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK; 516 + else 517 + dmab->dev.type = SNDRV_DMA_TYPE_DEV_SG_FALLBACK; 518 + return snd_dma_sg_fallback_alloc(dmab, size); 519 + #else 517 520 return NULL; 521 + #endif 522 + } 523 + 518 524 dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, 519 525 sg_dma_address(sgt->sgl)); 520 526 p = dma_vmap_noncontiguous(dmab->dev.dev, size, sgt); ··· 647 633 648 634 if (!p) 649 635 return NULL; 636 + if (dmab->dev.type != SNDRV_DMA_TYPE_DEV_WC_SG) 637 + return p; 650 638 for_each_sgtable_page(sgt, &iter, 0) 651 639 set_memory_wc(sg_wc_address(&iter), 1); 652 640 return p; ··· 680 664 .get_addr = snd_dma_noncontig_get_addr, 681 665 .get_page = snd_dma_noncontig_get_page, 682 666 .get_chunk_size = snd_dma_noncontig_get_chunk_size, 667 + }; 668 + 669 + /* Fallback SG-buffer allocations for x86 */ 670 + struct snd_dma_sg_fallback { 671 + size_t count; 672 + struct page **pages; 673 + dma_addr_t *addrs; 674 + }; 675 + 676 + static void __snd_dma_sg_fallback_free(struct snd_dma_buffer *dmab, 677 + struct snd_dma_sg_fallback *sgbuf) 678 + { 679 + size_t i; 680 + 681 + if (sgbuf->count && dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK) 682 + set_pages_array_wb(sgbuf->pages, sgbuf->count); 683 + for (i = 0; i < sgbuf->count && sgbuf->pages[i]; i++) 684 + dma_free_coherent(dmab->dev.dev, PAGE_SIZE, 685 + page_address(sgbuf->pages[i]), 686 + sgbuf->addrs[i]); 687 + kvfree(sgbuf->pages); 688 + kvfree(sgbuf->addrs); 689 + kfree(sgbuf); 690 + } 691 + 692 + static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size) 693 + { 694 + struct snd_dma_sg_fallback *sgbuf; 695 + struct page **pages; 696 + size_t i, count; 697 + void *p; 698 + 699 + sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL); 700 + if (!sgbuf) 701 + return NULL; 702 + count = PAGE_ALIGN(size) >> PAGE_SHIFT; 703 + pages = kvcalloc(count, sizeof(*pages), GFP_KERNEL); 704 + if (!pages) 705 + goto error; 706 + sgbuf->pages = pages; 707 + sgbuf->addrs = kvcalloc(count, sizeof(*sgbuf->addrs), GFP_KERNEL); 708 + if (!sgbuf->addrs) 709 + goto error; 710 + 711 + for (i = 0; i < count; sgbuf->count++, i++) { 712 + p = dma_alloc_coherent(dmab->dev.dev, PAGE_SIZE, 713 + &sgbuf->addrs[i], DEFAULT_GFP); 714 + if (!p) 715 + goto error; 716 + sgbuf->pages[i] = virt_to_page(p); 717 + } 718 + 719 + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK) 720 + set_pages_array_wc(pages, count); 721 + p = vmap(pages, count, VM_MAP, PAGE_KERNEL); 722 + if (!p) 723 + goto error; 724 + dmab->private_data = sgbuf; 725 + return p; 726 + 727 + error: 728 + __snd_dma_sg_fallback_free(dmab, sgbuf); 729 + return NULL; 730 + } 731 + 732 + static void snd_dma_sg_fallback_free(struct snd_dma_buffer *dmab) 733 + { 734 + vunmap(dmab->area); 735 + __snd_dma_sg_fallback_free(dmab, dmab->private_data); 736 + } 737 + 738 + static int snd_dma_sg_fallback_mmap(struct snd_dma_buffer *dmab, 739 + struct vm_area_struct *area) 740 + { 741 + struct snd_dma_sg_fallback *sgbuf = dmab->private_data; 742 + 743 + if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK) 744 + area->vm_page_prot = pgprot_writecombine(area->vm_page_prot); 745 + return vm_map_pages(area, sgbuf->pages, sgbuf->count); 746 + } 747 + 748 + static const struct snd_malloc_ops snd_dma_sg_fallback_ops = { 749 + .alloc = snd_dma_sg_fallback_alloc, 750 + .free = snd_dma_sg_fallback_free, 751 + .mmap = snd_dma_sg_fallback_mmap, 752 + /* reuse vmalloc helpers */ 753 + .get_addr = snd_dma_vmalloc_get_addr, 754 + .get_page = snd_dma_vmalloc_get_page, 755 + .get_chunk_size = snd_dma_vmalloc_get_chunk_size, 683 756 }; 684 757 #endif /* CONFIG_SND_DMA_SGBUF */ 685 758 ··· 841 736 #ifdef CONFIG_GENERIC_ALLOCATOR 842 737 [SNDRV_DMA_TYPE_DEV_IRAM] = &snd_dma_iram_ops, 843 738 #endif /* CONFIG_GENERIC_ALLOCATOR */ 739 + #ifdef CONFIG_SND_DMA_SGBUF 740 + [SNDRV_DMA_TYPE_DEV_SG_FALLBACK] = &snd_dma_sg_fallback_ops, 741 + [SNDRV_DMA_TYPE_DEV_WC_SG_FALLBACK] = &snd_dma_sg_fallback_ops, 742 + #endif 844 743 #endif /* CONFIG_HAS_DMA */ 845 744 }; 846 745
+1 -1
sound/core/pcm_misc.c
··· 433 433 return 0; 434 434 width = pcm_formats[(INT)format].phys; /* physical width */ 435 435 pat = pcm_formats[(INT)format].silence; 436 - if (! width) 436 + if (!width || !pat) 437 437 return -EINVAL; 438 438 /* signed or 1 byte data */ 439 439 if (pcm_formats[(INT)format].signd == 1 || width <= 8) {
+2 -2
sound/drivers/mtpav.c
··· 693 693 mtp_card->outmidihwport = 0xffffffff; 694 694 timer_setup(&mtp_card->timer, snd_mtpav_output_timer, 0); 695 695 696 - card->private_free = snd_mtpav_free; 697 - 698 696 err = snd_mtpav_get_RAWMIDI(mtp_card); 699 697 if (err < 0) 700 698 return err; ··· 713 715 err = snd_card_register(mtp_card->card); 714 716 if (err < 0) 715 717 return err; 718 + 719 + card->private_free = snd_mtpav_free; 716 720 717 721 platform_set_drvdata(dev, card); 718 722 printk(KERN_INFO "Motu MidiTimePiece on parallel port irq: %d ioport: 0x%lx\n", irq, port);
+19 -10
sound/hda/hdac_i915.c
··· 116 116 return 0; 117 117 } 118 118 119 - /* check whether intel graphics is present */ 120 - static bool i915_gfx_present(void) 119 + /* check whether Intel graphics is present and reachable */ 120 + static int i915_gfx_present(struct pci_dev *hdac_pci) 121 121 { 122 - static const struct pci_device_id ids[] = { 123 - { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_ANY_ID), 124 - .class = PCI_BASE_CLASS_DISPLAY << 16, 125 - .class_mask = 0xff << 16 }, 126 - {} 127 - }; 128 - return pci_dev_present(ids); 122 + unsigned int class = PCI_BASE_CLASS_DISPLAY << 16; 123 + struct pci_dev *display_dev = NULL; 124 + bool match = false; 125 + 126 + do { 127 + display_dev = pci_get_class(class, display_dev); 128 + 129 + if (display_dev && display_dev->vendor == PCI_VENDOR_ID_INTEL && 130 + connectivity_check(display_dev, hdac_pci)) 131 + match = true; 132 + 133 + pci_dev_put(display_dev); 134 + 135 + } while (!match && display_dev); 136 + 137 + return match; 129 138 } 130 139 131 140 /** ··· 154 145 struct drm_audio_component *acomp; 155 146 int err; 156 147 157 - if (!i915_gfx_present()) 148 + if (!i915_gfx_present(to_pci_dev(bus->dev))) 158 149 return -ENODEV; 159 150 160 151 err = snd_hdac_acomp_init(bus, NULL,
+18 -4
sound/hda/intel-dsp-config.c
··· 390 390 391 391 /* Alder Lake */ 392 392 #if IS_ENABLED(CONFIG_SND_SOC_SOF_ALDERLAKE) 393 + /* Alderlake-S */ 393 394 { 394 395 .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 395 396 .device = 0x7ad0, 396 397 }, 398 + /* RaptorLake-S */ 399 + { 400 + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 401 + .device = 0x7a50, 402 + }, 403 + /* Alderlake-P */ 397 404 { 398 405 .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 399 406 .device = 0x51c8, 400 407 }, 401 408 { 402 409 .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 403 - .device = 0x51cc, 404 - }, 405 - { 406 - .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 407 410 .device = 0x51cd, 408 411 }, 412 + /* Alderlake-PS */ 413 + { 414 + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 415 + .device = 0x51c9, 416 + }, 417 + /* Alderlake-M */ 418 + { 419 + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 420 + .device = 0x51cc, 421 + }, 422 + /* Alderlake-N */ 409 423 { 410 424 .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 411 425 .device = 0x54c8,
+6 -1
sound/isa/galaxy/galaxy.c
··· 478 478 galaxy_set_config(galaxy, galaxy->config); 479 479 } 480 480 481 - static int snd_galaxy_probe(struct device *dev, unsigned int n) 481 + static int __snd_galaxy_probe(struct device *dev, unsigned int n) 482 482 { 483 483 struct snd_galaxy *galaxy; 484 484 struct snd_wss *chip; ··· 596 596 597 597 dev_set_drvdata(dev, card); 598 598 return 0; 599 + } 600 + 601 + static int snd_galaxy_probe(struct device *dev, unsigned int n) 602 + { 603 + return snd_card_free_on_error(dev, __snd_galaxy_probe(dev, n)); 599 604 } 600 605 601 606 static struct isa_driver snd_galaxy_driver = {
+6 -1
sound/isa/sc6000.c
··· 537 537 sc6000_setup_board(vport, 0); 538 538 } 539 539 540 - static int snd_sc6000_probe(struct device *devptr, unsigned int dev) 540 + static int __snd_sc6000_probe(struct device *devptr, unsigned int dev) 541 541 { 542 542 static const int possible_irqs[] = { 5, 7, 9, 10, 11, -1 }; 543 543 static const int possible_dmas[] = { 1, 3, 0, -1 }; ··· 660 660 661 661 dev_set_drvdata(devptr, card); 662 662 return 0; 663 + } 664 + 665 + static int snd_sc6000_probe(struct device *devptr, unsigned int dev) 666 + { 667 + return snd_card_free_on_error(devptr, __snd_sc6000_probe(devptr, dev)); 663 668 } 664 669 665 670 static struct isa_driver snd_sc6000_driver = {
-6
sound/oss/dmasound/dmasound.h
··· 88 88 */ 89 89 90 90 extern int dmasound_init(void); 91 - #ifdef MODULE 92 91 extern void dmasound_deinit(void); 93 - #else 94 - #define dmasound_deinit() do { } while (0) 95 - #endif 96 92 97 93 /* description of the set-up applies to either hard or soft settings */ 98 94 ··· 110 114 void *(*dma_alloc)(unsigned int, gfp_t); 111 115 void (*dma_free)(void *, unsigned int); 112 116 int (*irqinit)(void); 113 - #ifdef MODULE 114 117 void (*irqcleanup)(void); 115 - #endif 116 118 void (*init)(void); 117 119 void (*silence)(void); 118 120 int (*setFormat)(int);
+1 -23
sound/oss/dmasound/dmasound_core.c
··· 206 206 207 207 MODULE_LICENSE("GPL"); 208 208 209 - #ifdef MODULE 210 209 static int sq_unit = -1; 211 210 static int mixer_unit = -1; 212 211 static int state_unit = -1; 213 212 static int irq_installed; 214 - #endif /* MODULE */ 215 213 216 214 /* control over who can modify resources shared between play/record */ 217 215 static fmode_t shared_resource_owner; ··· 389 391 390 392 static void mixer_init(void) 391 393 { 392 - #ifndef MODULE 393 - int mixer_unit; 394 - #endif 395 394 mixer_unit = register_sound_mixer(&mixer_fops, -1); 396 395 if (mixer_unit < 0) 397 396 return; ··· 1166 1171 static int sq_init(void) 1167 1172 { 1168 1173 const struct file_operations *fops = &sq_fops; 1169 - #ifndef MODULE 1170 - int sq_unit; 1171 - #endif 1172 1174 1173 1175 sq_unit = register_sound_dsp(fops, -1); 1174 1176 if (sq_unit < 0) { ··· 1358 1366 1359 1367 static int state_init(void) 1360 1368 { 1361 - #ifndef MODULE 1362 - int state_unit; 1363 - #endif 1364 1369 state_unit = register_sound_special(&state_fops, SND_DEV_STATUS); 1365 1370 if (state_unit < 0) 1366 1371 return state_unit ; ··· 1375 1386 int dmasound_init(void) 1376 1387 { 1377 1388 int res ; 1378 - #ifdef MODULE 1389 + 1379 1390 if (irq_installed) 1380 1391 return -EBUSY; 1381 - #endif 1382 1392 1383 1393 /* Set up sound queue, /dev/audio and /dev/dsp. */ 1384 1394 ··· 1396 1408 printk(KERN_ERR "DMA sound driver: Interrupt initialization failed\n"); 1397 1409 return -ENODEV; 1398 1410 } 1399 - #ifdef MODULE 1400 1411 irq_installed = 1; 1401 - #endif 1402 1412 1403 1413 printk(KERN_INFO "%s DMA sound driver rev %03d installed\n", 1404 1414 dmasound.mach.name, (DMASOUND_CORE_REVISION<<4) + ··· 1409 1423 numWriteBufs, writeBufSize) ; 1410 1424 return 0; 1411 1425 } 1412 - 1413 - #ifdef MODULE 1414 1426 1415 1427 void dmasound_deinit(void) 1416 1428 { ··· 1427 1443 if (sq_unit >= 0) 1428 1444 unregister_sound_dsp(sq_unit); 1429 1445 } 1430 - 1431 - #else /* !MODULE */ 1432 1446 1433 1447 static int dmasound_setup(char *str) 1434 1448 { ··· 1470 1488 } 1471 1489 1472 1490 __setup("dmasound=", dmasound_setup); 1473 - 1474 - #endif /* !MODULE */ 1475 1491 1476 1492 /* 1477 1493 * Conversion tables ··· 1557 1577 1558 1578 EXPORT_SYMBOL(dmasound); 1559 1579 EXPORT_SYMBOL(dmasound_init); 1560 - #ifdef MODULE 1561 1580 EXPORT_SYMBOL(dmasound_deinit); 1562 - #endif 1563 1581 EXPORT_SYMBOL(dmasound_write_sq); 1564 1582 EXPORT_SYMBOL(dmasound_catchRadius); 1565 1583 #ifdef HAS_8BIT_TABLES
+8 -2
sound/pci/ad1889.c
··· 844 844 } 845 845 846 846 static int 847 - snd_ad1889_probe(struct pci_dev *pci, 848 - const struct pci_device_id *pci_id) 847 + __snd_ad1889_probe(struct pci_dev *pci, 848 + const struct pci_device_id *pci_id) 849 849 { 850 850 int err; 851 851 static int devno; ··· 902 902 903 903 devno++; 904 904 return 0; 905 + } 906 + 907 + static int snd_ad1889_probe(struct pci_dev *pci, 908 + const struct pci_device_id *pci_id) 909 + { 910 + return snd_card_free_on_error(&pci->dev, __snd_ad1889_probe(pci, pci_id)); 905 911 } 906 912 907 913 static const struct pci_device_id snd_ad1889_ids[] = {
+8 -2
sound/pci/ali5451/ali5451.c
··· 2124 2124 return 0; 2125 2125 } 2126 2126 2127 - static int snd_ali_probe(struct pci_dev *pci, 2128 - const struct pci_device_id *pci_id) 2127 + static int __snd_ali_probe(struct pci_dev *pci, 2128 + const struct pci_device_id *pci_id) 2129 2129 { 2130 2130 struct snd_card *card; 2131 2131 struct snd_ali *codec; ··· 2168 2168 2169 2169 pci_set_drvdata(pci, card); 2170 2170 return 0; 2171 + } 2172 + 2173 + static int snd_ali_probe(struct pci_dev *pci, 2174 + const struct pci_device_id *pci_id) 2175 + { 2176 + return snd_card_free_on_error(&pci->dev, __snd_ali_probe(pci, pci_id)); 2171 2177 } 2172 2178 2173 2179 static struct pci_driver ali5451_driver = {
+6 -2
sound/pci/als300.c
··· 708 708 709 709 err = snd_als300_create(card, pci, chip_type); 710 710 if (err < 0) 711 - return err; 711 + goto error; 712 712 713 713 strcpy(card->driver, "ALS300"); 714 714 if (chip->chip_type == DEVICE_ALS300_PLUS) ··· 723 723 724 724 err = snd_card_register(card); 725 725 if (err < 0) 726 - return err; 726 + goto error; 727 727 728 728 pci_set_drvdata(pci, card); 729 729 dev++; 730 730 return 0; 731 + 732 + error: 733 + snd_card_free(card); 734 + return err; 731 735 } 732 736 733 737 static struct pci_driver als300_driver = {
+8 -2
sound/pci/als4000.c
··· 806 806 snd_als4000_free_gameport(acard); 807 807 } 808 808 809 - static int snd_card_als4000_probe(struct pci_dev *pci, 810 - const struct pci_device_id *pci_id) 809 + static int __snd_card_als4000_probe(struct pci_dev *pci, 810 + const struct pci_device_id *pci_id) 811 811 { 812 812 static int dev; 813 813 struct snd_card *card; ··· 928 928 pci_set_drvdata(pci, card); 929 929 dev++; 930 930 return 0; 931 + } 932 + 933 + static int snd_card_als4000_probe(struct pci_dev *pci, 934 + const struct pci_device_id *pci_id) 935 + { 936 + return snd_card_free_on_error(&pci->dev, __snd_card_als4000_probe(pci, pci_id)); 931 937 } 932 938 933 939 #ifdef CONFIG_PM_SLEEP
+8 -2
sound/pci/atiixp.c
··· 1572 1572 } 1573 1573 1574 1574 1575 - static int snd_atiixp_probe(struct pci_dev *pci, 1576 - const struct pci_device_id *pci_id) 1575 + static int __snd_atiixp_probe(struct pci_dev *pci, 1576 + const struct pci_device_id *pci_id) 1577 1577 { 1578 1578 struct snd_card *card; 1579 1579 struct atiixp *chip; ··· 1621 1621 1622 1622 pci_set_drvdata(pci, card); 1623 1623 return 0; 1624 + } 1625 + 1626 + static int snd_atiixp_probe(struct pci_dev *pci, 1627 + const struct pci_device_id *pci_id) 1628 + { 1629 + return snd_card_free_on_error(&pci->dev, __snd_atiixp_probe(pci, pci_id)); 1624 1630 } 1625 1631 1626 1632 static struct pci_driver atiixp_driver = {
+8 -2
sound/pci/atiixp_modem.c
··· 1201 1201 } 1202 1202 1203 1203 1204 - static int snd_atiixp_probe(struct pci_dev *pci, 1205 - const struct pci_device_id *pci_id) 1204 + static int __snd_atiixp_probe(struct pci_dev *pci, 1205 + const struct pci_device_id *pci_id) 1206 1206 { 1207 1207 struct snd_card *card; 1208 1208 struct atiixp_modem *chip; ··· 1245 1245 1246 1246 pci_set_drvdata(pci, card); 1247 1247 return 0; 1248 + } 1249 + 1250 + static int snd_atiixp_probe(struct pci_dev *pci, 1251 + const struct pci_device_id *pci_id) 1252 + { 1253 + return snd_card_free_on_error(&pci->dev, __snd_atiixp_probe(pci, pci_id)); 1248 1254 } 1249 1255 1250 1256 static struct pci_driver atiixp_modem_driver = {
+7 -1
sound/pci/au88x0/au88x0.c
··· 193 193 194 194 // constructor -- see "Constructor" sub-section 195 195 static int 196 - snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 196 + __snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 197 197 { 198 198 static int dev; 199 199 struct snd_card *card; ··· 308 308 vortex_connect_default(chip, 1); 309 309 vortex_enable_int(chip); 310 310 return 0; 311 + } 312 + 313 + static int 314 + snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 315 + { 316 + return snd_card_free_on_error(&pci->dev, __snd_vortex_probe(pci, pci_id)); 311 317 } 312 318 313 319 // pci_driver definition
+6 -2
sound/pci/aw2/aw2-alsa.c
··· 275 275 /* (3) Create main component */ 276 276 err = snd_aw2_create(card, pci); 277 277 if (err < 0) 278 - return err; 278 + goto error; 279 279 280 280 /* initialize mutex */ 281 281 mutex_init(&chip->mtx); ··· 294 294 /* (6) Register card instance */ 295 295 err = snd_card_register(card); 296 296 if (err < 0) 297 - return err; 297 + goto error; 298 298 299 299 /* (7) Set PCI driver data */ 300 300 pci_set_drvdata(pci, card); 301 301 302 302 dev++; 303 303 return 0; 304 + 305 + error: 306 + snd_card_free(card); 307 + return err; 304 308 } 305 309 306 310 /* open callback */
+7 -1
sound/pci/azt3328.c
··· 2427 2427 } 2428 2428 2429 2429 static int 2430 - snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2430 + __snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2431 2431 { 2432 2432 static int dev; 2433 2433 struct snd_card *card; ··· 2518 2518 pci_set_drvdata(pci, card); 2519 2519 dev++; 2520 2520 return 0; 2521 + } 2522 + 2523 + static int 2524 + snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2525 + { 2526 + return snd_card_free_on_error(&pci->dev, __snd_azf3328_probe(pci, pci_id)); 2521 2527 } 2522 2528 2523 2529 #ifdef CONFIG_PM_SLEEP
+8 -2
sound/pci/bt87x.c
··· 805 805 return SND_BT87X_BOARD_UNKNOWN; 806 806 } 807 807 808 - static int snd_bt87x_probe(struct pci_dev *pci, 809 - const struct pci_device_id *pci_id) 808 + static int __snd_bt87x_probe(struct pci_dev *pci, 809 + const struct pci_device_id *pci_id) 810 810 { 811 811 static int dev; 812 812 struct snd_card *card; ··· 887 887 pci_set_drvdata(pci, card); 888 888 ++dev; 889 889 return 0; 890 + } 891 + 892 + static int snd_bt87x_probe(struct pci_dev *pci, 893 + const struct pci_device_id *pci_id) 894 + { 895 + return snd_card_free_on_error(&pci->dev, __snd_bt87x_probe(pci, pci_id)); 890 896 } 891 897 892 898 /* default entries for all Bt87x cards - it's not exported */
+8 -2
sound/pci/ca0106/ca0106_main.c
··· 1725 1725 } 1726 1726 1727 1727 1728 - static int snd_ca0106_probe(struct pci_dev *pci, 1729 - const struct pci_device_id *pci_id) 1728 + static int __snd_ca0106_probe(struct pci_dev *pci, 1729 + const struct pci_device_id *pci_id) 1730 1730 { 1731 1731 static int dev; 1732 1732 struct snd_card *card; ··· 1784 1784 pci_set_drvdata(pci, card); 1785 1785 dev++; 1786 1786 return 0; 1787 + } 1788 + 1789 + static int snd_ca0106_probe(struct pci_dev *pci, 1790 + const struct pci_device_id *pci_id) 1791 + { 1792 + return snd_card_free_on_error(&pci->dev, __snd_ca0106_probe(pci, pci_id)); 1787 1793 } 1788 1794 1789 1795 #ifdef CONFIG_PM_SLEEP
+6 -2
sound/pci/cmipci.c
··· 3247 3247 3248 3248 err = snd_cmipci_create(card, pci, dev); 3249 3249 if (err < 0) 3250 - return err; 3250 + goto error; 3251 3251 3252 3252 err = snd_card_register(card); 3253 3253 if (err < 0) 3254 - return err; 3254 + goto error; 3255 3255 3256 3256 pci_set_drvdata(pci, card); 3257 3257 dev++; 3258 3258 return 0; 3259 + 3260 + error: 3261 + snd_card_free(card); 3262 + return err; 3259 3263 } 3260 3264 3261 3265 #ifdef CONFIG_PM_SLEEP
+8 -2
sound/pci/cs4281.c
··· 1827 1827 spin_unlock_irqrestore(&opl3->reg_lock, flags); 1828 1828 } 1829 1829 1830 - static int snd_cs4281_probe(struct pci_dev *pci, 1831 - const struct pci_device_id *pci_id) 1830 + static int __snd_cs4281_probe(struct pci_dev *pci, 1831 + const struct pci_device_id *pci_id) 1832 1832 { 1833 1833 static int dev; 1834 1834 struct snd_card *card; ··· 1886 1886 pci_set_drvdata(pci, card); 1887 1887 dev++; 1888 1888 return 0; 1889 + } 1890 + 1891 + static int snd_cs4281_probe(struct pci_dev *pci, 1892 + const struct pci_device_id *pci_id) 1893 + { 1894 + return snd_card_free_on_error(&pci->dev, __snd_cs4281_probe(pci, pci_id)); 1889 1895 } 1890 1896 1891 1897 /*
+8 -2
sound/pci/cs5535audio/cs5535audio.c
··· 281 281 return 0; 282 282 } 283 283 284 - static int snd_cs5535audio_probe(struct pci_dev *pci, 285 - const struct pci_device_id *pci_id) 284 + static int __snd_cs5535audio_probe(struct pci_dev *pci, 285 + const struct pci_device_id *pci_id) 286 286 { 287 287 static int dev; 288 288 struct snd_card *card; ··· 329 329 pci_set_drvdata(pci, card); 330 330 dev++; 331 331 return 0; 332 + } 333 + 334 + static int snd_cs5535audio_probe(struct pci_dev *pci, 335 + const struct pci_device_id *pci_id) 336 + { 337 + return snd_card_free_on_error(&pci->dev, __snd_cs5535audio_probe(pci, pci_id)); 332 338 } 333 339 334 340 static struct pci_driver cs5535audio_driver = {
+7 -2
sound/pci/echoaudio/echoaudio.c
··· 1970 1970 } 1971 1971 1972 1972 /* constructor */ 1973 - static int snd_echo_probe(struct pci_dev *pci, 1974 - const struct pci_device_id *pci_id) 1973 + static int __snd_echo_probe(struct pci_dev *pci, 1974 + const struct pci_device_id *pci_id) 1975 1975 { 1976 1976 static int dev; 1977 1977 struct snd_card *card; ··· 2139 2139 return 0; 2140 2140 } 2141 2141 2142 + static int snd_echo_probe(struct pci_dev *pci, 2143 + const struct pci_device_id *pci_id) 2144 + { 2145 + return snd_card_free_on_error(&pci->dev, __snd_echo_probe(pci, pci_id)); 2146 + } 2142 2147 2143 2148 2144 2149 #if defined(CONFIG_PM_SLEEP)
+8 -2
sound/pci/emu10k1/emu10k1x.c
··· 1491 1491 return 0; 1492 1492 } 1493 1493 1494 - static int snd_emu10k1x_probe(struct pci_dev *pci, 1495 - const struct pci_device_id *pci_id) 1494 + static int __snd_emu10k1x_probe(struct pci_dev *pci, 1495 + const struct pci_device_id *pci_id) 1496 1496 { 1497 1497 static int dev; 1498 1498 struct snd_card *card; ··· 1552 1552 pci_set_drvdata(pci, card); 1553 1553 dev++; 1554 1554 return 0; 1555 + } 1556 + 1557 + static int snd_emu10k1x_probe(struct pci_dev *pci, 1558 + const struct pci_device_id *pci_id) 1559 + { 1560 + return snd_card_free_on_error(&pci->dev, __snd_emu10k1x_probe(pci, pci_id)); 1555 1561 } 1556 1562 1557 1563 // PCI IDs
+8 -2
sound/pci/ens1370.c
··· 2304 2304 return IRQ_HANDLED; 2305 2305 } 2306 2306 2307 - static int snd_audiopci_probe(struct pci_dev *pci, 2308 - const struct pci_device_id *pci_id) 2307 + static int __snd_audiopci_probe(struct pci_dev *pci, 2308 + const struct pci_device_id *pci_id) 2309 2309 { 2310 2310 static int dev; 2311 2311 struct snd_card *card; ··· 2367 2367 pci_set_drvdata(pci, card); 2368 2368 dev++; 2369 2369 return 0; 2370 + } 2371 + 2372 + static int snd_audiopci_probe(struct pci_dev *pci, 2373 + const struct pci_device_id *pci_id) 2374 + { 2375 + return snd_card_free_on_error(&pci->dev, __snd_audiopci_probe(pci, pci_id)); 2370 2376 } 2371 2377 2372 2378 static struct pci_driver ens137x_driver = {
+8 -2
sound/pci/es1938.c
··· 1716 1716 } 1717 1717 1718 1718 1719 - static int snd_es1938_probe(struct pci_dev *pci, 1720 - const struct pci_device_id *pci_id) 1719 + static int __snd_es1938_probe(struct pci_dev *pci, 1720 + const struct pci_device_id *pci_id) 1721 1721 { 1722 1722 static int dev; 1723 1723 struct snd_card *card; ··· 1794 1794 pci_set_drvdata(pci, card); 1795 1795 dev++; 1796 1796 return 0; 1797 + } 1798 + 1799 + static int snd_es1938_probe(struct pci_dev *pci, 1800 + const struct pci_device_id *pci_id) 1801 + { 1802 + return snd_card_free_on_error(&pci->dev, __snd_es1938_probe(pci, pci_id)); 1797 1803 } 1798 1804 1799 1805 static struct pci_driver es1938_driver = {
+8 -2
sound/pci/es1968.c
··· 2741 2741 2742 2742 /* 2743 2743 */ 2744 - static int snd_es1968_probe(struct pci_dev *pci, 2745 - const struct pci_device_id *pci_id) 2744 + static int __snd_es1968_probe(struct pci_dev *pci, 2745 + const struct pci_device_id *pci_id) 2746 2746 { 2747 2747 static int dev; 2748 2748 struct snd_card *card; ··· 2846 2846 pci_set_drvdata(pci, card); 2847 2847 dev++; 2848 2848 return 0; 2849 + } 2850 + 2851 + static int snd_es1968_probe(struct pci_dev *pci, 2852 + const struct pci_device_id *pci_id) 2853 + { 2854 + return snd_card_free_on_error(&pci->dev, __snd_es1968_probe(pci, pci_id)); 2849 2855 } 2850 2856 2851 2857 static struct pci_driver es1968_driver = {
+8 -2
sound/pci/fm801.c
··· 1268 1268 return 0; 1269 1269 } 1270 1270 1271 - static int snd_card_fm801_probe(struct pci_dev *pci, 1272 - const struct pci_device_id *pci_id) 1271 + static int __snd_card_fm801_probe(struct pci_dev *pci, 1272 + const struct pci_device_id *pci_id) 1273 1273 { 1274 1274 static int dev; 1275 1275 struct snd_card *card; ··· 1331 1331 pci_set_drvdata(pci, card); 1332 1332 dev++; 1333 1333 return 0; 1334 + } 1335 + 1336 + static int snd_card_fm801_probe(struct pci_dev *pci, 1337 + const struct pci_device_id *pci_id) 1338 + { 1339 + return snd_card_free_on_error(&pci->dev, __snd_card_fm801_probe(pci, pci_id)); 1334 1340 } 1335 1341 1336 1342 #ifdef CONFIG_PM_SLEEP
+2
sound/pci/hda/patch_realtek.c
··· 2619 2619 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2620 2620 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2621 2621 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2622 + SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2622 2623 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2623 2624 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), 2624 2625 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), ··· 9265 9264 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 9266 9265 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 9267 9266 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 9267 + SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), 9268 9268 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 9269 9269 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), 9270 9270 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
+8 -2
sound/pci/ice1712/ice1724.c
··· 2519 2519 * 2520 2520 */ 2521 2521 2522 - static int snd_vt1724_probe(struct pci_dev *pci, 2523 - const struct pci_device_id *pci_id) 2522 + static int __snd_vt1724_probe(struct pci_dev *pci, 2523 + const struct pci_device_id *pci_id) 2524 2524 { 2525 2525 static int dev; 2526 2526 struct snd_card *card; ··· 2660 2660 pci_set_drvdata(pci, card); 2661 2661 dev++; 2662 2662 return 0; 2663 + } 2664 + 2665 + static int snd_vt1724_probe(struct pci_dev *pci, 2666 + const struct pci_device_id *pci_id) 2667 + { 2668 + return snd_card_free_on_error(&pci->dev, __snd_vt1724_probe(pci, pci_id)); 2663 2669 } 2664 2670 2665 2671 #ifdef CONFIG_PM_SLEEP
+8 -2
sound/pci/intel8x0.c
··· 3109 3109 return 0; 3110 3110 } 3111 3111 3112 - static int snd_intel8x0_probe(struct pci_dev *pci, 3113 - const struct pci_device_id *pci_id) 3112 + static int __snd_intel8x0_probe(struct pci_dev *pci, 3113 + const struct pci_device_id *pci_id) 3114 3114 { 3115 3115 struct snd_card *card; 3116 3116 struct intel8x0 *chip; ··· 3187 3187 3188 3188 pci_set_drvdata(pci, card); 3189 3189 return 0; 3190 + } 3191 + 3192 + static int snd_intel8x0_probe(struct pci_dev *pci, 3193 + const struct pci_device_id *pci_id) 3194 + { 3195 + return snd_card_free_on_error(&pci->dev, __snd_intel8x0_probe(pci, pci_id)); 3190 3196 } 3191 3197 3192 3198 static struct pci_driver intel8x0_driver = {
+8 -2
sound/pci/intel8x0m.c
··· 1178 1178 { 0 }, 1179 1179 }; 1180 1180 1181 - static int snd_intel8x0m_probe(struct pci_dev *pci, 1182 - const struct pci_device_id *pci_id) 1181 + static int __snd_intel8x0m_probe(struct pci_dev *pci, 1182 + const struct pci_device_id *pci_id) 1183 1183 { 1184 1184 struct snd_card *card; 1185 1185 struct intel8x0m *chip; ··· 1223 1223 return err; 1224 1224 pci_set_drvdata(pci, card); 1225 1225 return 0; 1226 + } 1227 + 1228 + static int snd_intel8x0m_probe(struct pci_dev *pci, 1229 + const struct pci_device_id *pci_id) 1230 + { 1231 + return snd_card_free_on_error(&pci->dev, __snd_intel8x0m_probe(pci, pci_id)); 1226 1232 } 1227 1233 1228 1234 static struct pci_driver intel8x0m_driver = {
+6 -2
sound/pci/korg1212/korg1212.c
··· 2355 2355 2356 2356 err = snd_korg1212_create(card, pci); 2357 2357 if (err < 0) 2358 - return err; 2358 + goto error; 2359 2359 2360 2360 strcpy(card->driver, "korg1212"); 2361 2361 strcpy(card->shortname, "korg1212"); ··· 2366 2366 2367 2367 err = snd_card_register(card); 2368 2368 if (err < 0) 2369 - return err; 2369 + goto error; 2370 2370 pci_set_drvdata(pci, card); 2371 2371 dev++; 2372 2372 return 0; 2373 + 2374 + error: 2375 + snd_card_free(card); 2376 + return err; 2373 2377 } 2374 2378 2375 2379 static struct pci_driver korg1212_driver = {
+8 -2
sound/pci/lola/lola.c
··· 637 637 return 0; 638 638 } 639 639 640 - static int lola_probe(struct pci_dev *pci, 641 - const struct pci_device_id *pci_id) 640 + static int __lola_probe(struct pci_dev *pci, 641 + const struct pci_device_id *pci_id) 642 642 { 643 643 static int dev; 644 644 struct snd_card *card; ··· 685 685 pci_set_drvdata(pci, card); 686 686 dev++; 687 687 return 0; 688 + } 689 + 690 + static int lola_probe(struct pci_dev *pci, 691 + const struct pci_device_id *pci_id) 692 + { 693 + return snd_card_free_on_error(&pci->dev, __lola_probe(pci, pci_id)); 688 694 } 689 695 690 696 /* PCI IDs */
+6 -2
sound/pci/lx6464es/lx6464es.c
··· 1019 1019 err = snd_lx6464es_create(card, pci); 1020 1020 if (err < 0) { 1021 1021 dev_err(card->dev, "error during snd_lx6464es_create\n"); 1022 - return err; 1022 + goto error; 1023 1023 } 1024 1024 1025 1025 strcpy(card->driver, "LX6464ES"); ··· 1036 1036 1037 1037 err = snd_card_register(card); 1038 1038 if (err < 0) 1039 - return err; 1039 + goto error; 1040 1040 1041 1041 dev_dbg(chip->card->dev, "initialization successful\n"); 1042 1042 pci_set_drvdata(pci, card); 1043 1043 dev++; 1044 1044 return 0; 1045 + 1046 + error: 1047 + snd_card_free(card); 1048 + return err; 1045 1049 } 1046 1050 1047 1051 static struct pci_driver lx6464es_driver = {
+7 -1
sound/pci/maestro3.c
··· 2637 2637 /* 2638 2638 */ 2639 2639 static int 2640 - snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2640 + __snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2641 2641 { 2642 2642 static int dev; 2643 2643 struct snd_card *card; ··· 2700 2700 pci_set_drvdata(pci, card); 2701 2701 dev++; 2702 2702 return 0; 2703 + } 2704 + 2705 + static int 2706 + snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2707 + { 2708 + return snd_card_free_on_error(&pci->dev, __snd_m3_probe(pci, pci_id)); 2703 2709 } 2704 2710 2705 2711 static struct pci_driver m3_driver = {
+1 -1
sound/pci/nm256/nm256.c
··· 1573 1573 chip->coeffs_current = 0; 1574 1574 1575 1575 snd_nm256_init_chip(chip); 1576 - card->private_free = snd_nm256_free; 1577 1576 1578 1577 // pci_set_master(pci); /* needed? */ 1579 1578 return 0; ··· 1679 1680 err = snd_card_register(card); 1680 1681 if (err < 0) 1681 1682 return err; 1683 + card->private_free = snd_nm256_free; 1682 1684 1683 1685 pci_set_drvdata(pci, card); 1684 1686 return 0;
+11 -1
sound/pci/oxygen/oxygen_lib.c
··· 576 576 mutex_destroy(&chip->mutex); 577 577 } 578 578 579 - int oxygen_pci_probe(struct pci_dev *pci, int index, char *id, 579 + static int __oxygen_pci_probe(struct pci_dev *pci, int index, char *id, 580 580 struct module *owner, 581 581 const struct pci_device_id *ids, 582 582 int (*get_model)(struct oxygen *chip, ··· 700 700 701 701 pci_set_drvdata(pci, card); 702 702 return 0; 703 + } 704 + 705 + int oxygen_pci_probe(struct pci_dev *pci, int index, char *id, 706 + struct module *owner, 707 + const struct pci_device_id *ids, 708 + int (*get_model)(struct oxygen *chip, 709 + const struct pci_device_id *id)) 710 + { 711 + return snd_card_free_on_error(&pci->dev, 712 + __oxygen_pci_probe(pci, index, id, owner, ids, get_model)); 703 713 } 704 714 EXPORT_SYMBOL(oxygen_pci_probe); 705 715
+7 -1
sound/pci/riptide/riptide.c
··· 2023 2023 #endif 2024 2024 2025 2025 static int 2026 - snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2026 + __snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2027 2027 { 2028 2028 static int dev; 2029 2029 struct snd_card *card; ··· 2122 2122 pci_set_drvdata(pci, card); 2123 2123 dev++; 2124 2124 return 0; 2125 + } 2126 + 2127 + static int 2128 + snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 2129 + { 2130 + return snd_card_free_on_error(&pci->dev, __snd_card_riptide_probe(pci, pci_id)); 2125 2131 } 2126 2132 2127 2133 static struct pci_driver driver = {
+7 -1
sound/pci/rme32.c
··· 1875 1875 } 1876 1876 1877 1877 static int 1878 - snd_rme32_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 1878 + __snd_rme32_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 1879 1879 { 1880 1880 static int dev; 1881 1881 struct rme32 *rme32; ··· 1925 1925 pci_set_drvdata(pci, card); 1926 1926 dev++; 1927 1927 return 0; 1928 + } 1929 + 1930 + static int 1931 + snd_rme32_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 1932 + { 1933 + return snd_card_free_on_error(&pci->dev, __snd_rme32_probe(pci, pci_id)); 1928 1934 } 1929 1935 1930 1936 static struct pci_driver rme32_driver = {
+8 -2
sound/pci/rme96.c
··· 2430 2430 } 2431 2431 2432 2432 static int 2433 - snd_rme96_probe(struct pci_dev *pci, 2434 - const struct pci_device_id *pci_id) 2433 + __snd_rme96_probe(struct pci_dev *pci, 2434 + const struct pci_device_id *pci_id) 2435 2435 { 2436 2436 static int dev; 2437 2437 struct rme96 *rme96; ··· 2496 2496 pci_set_drvdata(pci, card); 2497 2497 dev++; 2498 2498 return 0; 2499 + } 2500 + 2501 + static int snd_rme96_probe(struct pci_dev *pci, 2502 + const struct pci_device_id *pci_id) 2503 + { 2504 + return snd_card_free_on_error(&pci->dev, __snd_rme96_probe(pci, pci_id)); 2499 2505 } 2500 2506 2501 2507 static struct pci_driver rme96_driver = {
+6 -2
sound/pci/rme9652/hdsp.c
··· 5444 5444 hdsp->pci = pci; 5445 5445 err = snd_hdsp_create(card, hdsp); 5446 5446 if (err) 5447 - return err; 5447 + goto error; 5448 5448 5449 5449 strcpy(card->shortname, "Hammerfall DSP"); 5450 5450 sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name, 5451 5451 hdsp->port, hdsp->irq); 5452 5452 err = snd_card_register(card); 5453 5453 if (err) 5454 - return err; 5454 + goto error; 5455 5455 pci_set_drvdata(pci, card); 5456 5456 dev++; 5457 5457 return 0; 5458 + 5459 + error: 5460 + snd_card_free(card); 5461 + return err; 5458 5462 } 5459 5463 5460 5464 static struct pci_driver hdsp_driver = {
+6 -2
sound/pci/rme9652/hdspm.c
··· 6895 6895 6896 6896 err = snd_hdspm_create(card, hdspm); 6897 6897 if (err < 0) 6898 - return err; 6898 + goto error; 6899 6899 6900 6900 if (hdspm->io_type != MADIface) { 6901 6901 snprintf(card->shortname, sizeof(card->shortname), "%s_%x", ··· 6914 6914 6915 6915 err = snd_card_register(card); 6916 6916 if (err < 0) 6917 - return err; 6917 + goto error; 6918 6918 6919 6919 pci_set_drvdata(pci, card); 6920 6920 6921 6921 dev++; 6922 6922 return 0; 6923 + 6924 + error: 6925 + snd_card_free(card); 6926 + return err; 6923 6927 } 6924 6928 6925 6929 static struct pci_driver hdspm_driver = {
+6 -2
sound/pci/rme9652/rme9652.c
··· 2572 2572 rme9652->pci = pci; 2573 2573 err = snd_rme9652_create(card, rme9652, precise_ptr[dev]); 2574 2574 if (err) 2575 - return err; 2575 + goto error; 2576 2576 2577 2577 strcpy(card->shortname, rme9652->card_name); 2578 2578 ··· 2580 2580 card->shortname, rme9652->port, rme9652->irq); 2581 2581 err = snd_card_register(card); 2582 2582 if (err) 2583 - return err; 2583 + goto error; 2584 2584 pci_set_drvdata(pci, card); 2585 2585 dev++; 2586 2586 return 0; 2587 + 2588 + error: 2589 + snd_card_free(card); 2590 + return err; 2587 2591 } 2588 2592 2589 2593 static struct pci_driver rme9652_driver = {
+10 -4
sound/pci/sis7019.c
··· 1331 1331 return 0; 1332 1332 } 1333 1333 1334 - static int snd_sis7019_probe(struct pci_dev *pci, 1335 - const struct pci_device_id *pci_id) 1334 + static int __snd_sis7019_probe(struct pci_dev *pci, 1335 + const struct pci_device_id *pci_id) 1336 1336 { 1337 1337 struct snd_card *card; 1338 1338 struct sis7019 *sis; ··· 1352 1352 if (!codecs) 1353 1353 codecs = SIS_PRIMARY_CODEC_PRESENT; 1354 1354 1355 - rc = snd_card_new(&pci->dev, index, id, THIS_MODULE, 1356 - sizeof(*sis), &card); 1355 + rc = snd_devm_card_new(&pci->dev, index, id, THIS_MODULE, 1356 + sizeof(*sis), &card); 1357 1357 if (rc < 0) 1358 1358 return rc; 1359 1359 ··· 1384 1384 1385 1385 pci_set_drvdata(pci, card); 1386 1386 return 0; 1387 + } 1388 + 1389 + static int snd_sis7019_probe(struct pci_dev *pci, 1390 + const struct pci_device_id *pci_id) 1391 + { 1392 + return snd_card_free_on_error(&pci->dev, __snd_sis7019_probe(pci, pci_id)); 1387 1393 } 1388 1394 1389 1395 static struct pci_driver sis7019_driver = {
+8 -2
sound/pci/sonicvibes.c
··· 1387 1387 return 0; 1388 1388 } 1389 1389 1390 - static int snd_sonic_probe(struct pci_dev *pci, 1391 - const struct pci_device_id *pci_id) 1390 + static int __snd_sonic_probe(struct pci_dev *pci, 1391 + const struct pci_device_id *pci_id) 1392 1392 { 1393 1393 static int dev; 1394 1394 struct snd_card *card; ··· 1457 1457 pci_set_drvdata(pci, card); 1458 1458 dev++; 1459 1459 return 0; 1460 + } 1461 + 1462 + static int snd_sonic_probe(struct pci_dev *pci, 1463 + const struct pci_device_id *pci_id) 1464 + { 1465 + return snd_card_free_on_error(&pci->dev, __snd_sonic_probe(pci, pci_id)); 1460 1466 } 1461 1467 1462 1468 static struct pci_driver sonicvibes_driver = {
+8 -2
sound/pci/via82xx.c
··· 2458 2458 return VIA_DXS_48K; 2459 2459 }; 2460 2460 2461 - static int snd_via82xx_probe(struct pci_dev *pci, 2462 - const struct pci_device_id *pci_id) 2461 + static int __snd_via82xx_probe(struct pci_dev *pci, 2462 + const struct pci_device_id *pci_id) 2463 2463 { 2464 2464 struct snd_card *card; 2465 2465 struct via82xx *chip; ··· 2567 2567 return err; 2568 2568 pci_set_drvdata(pci, card); 2569 2569 return 0; 2570 + } 2571 + 2572 + static int snd_via82xx_probe(struct pci_dev *pci, 2573 + const struct pci_device_id *pci_id) 2574 + { 2575 + return snd_card_free_on_error(&pci->dev, __snd_via82xx_probe(pci, pci_id)); 2570 2576 } 2571 2577 2572 2578 static struct pci_driver via82xx_driver = {
+8 -2
sound/pci/via82xx_modem.c
··· 1103 1103 } 1104 1104 1105 1105 1106 - static int snd_via82xx_probe(struct pci_dev *pci, 1107 - const struct pci_device_id *pci_id) 1106 + static int __snd_via82xx_probe(struct pci_dev *pci, 1107 + const struct pci_device_id *pci_id) 1108 1108 { 1109 1109 struct snd_card *card; 1110 1110 struct via82xx_modem *chip; ··· 1155 1155 return err; 1156 1156 pci_set_drvdata(pci, card); 1157 1157 return 0; 1158 + } 1159 + 1160 + static int snd_via82xx_probe(struct pci_dev *pci, 1161 + const struct pci_device_id *pci_id) 1162 + { 1163 + return snd_card_free_on_error(&pci->dev, __snd_via82xx_probe(pci, pci_id)); 1158 1164 } 1159 1165 1160 1166 static struct pci_driver via82xx_modem_driver = {
+14 -2
sound/usb/pcm.c
··· 669 669 SNDRV_PCM_INFO_PAUSE, 670 670 .channels_min = 1, 671 671 .channels_max = 256, 672 - .buffer_bytes_max = 1024 * 1024, 672 + .buffer_bytes_max = INT_MAX, /* limited by BUFFER_TIME later */ 673 673 .period_bytes_min = 64, 674 - .period_bytes_max = 512 * 1024, 674 + .period_bytes_max = INT_MAX, /* limited by PERIOD_TIME later */ 675 675 .periods_min = 2, 676 676 .periods_max = 1024, 677 677 }; ··· 1063 1063 if (err < 0) 1064 1064 return err; 1065 1065 } 1066 + 1067 + /* set max period and buffer sizes for 1 and 2 seconds, respectively */ 1068 + err = snd_pcm_hw_constraint_minmax(runtime, 1069 + SNDRV_PCM_HW_PARAM_PERIOD_TIME, 1070 + 0, 1000000); 1071 + if (err < 0) 1072 + return err; 1073 + err = snd_pcm_hw_constraint_minmax(runtime, 1074 + SNDRV_PCM_HW_PARAM_BUFFER_TIME, 1075 + 0, 2000000); 1076 + if (err < 0) 1077 + return err; 1066 1078 1067 1079 /* additional hw constraints for implicit fb */ 1068 1080 err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT,
+1 -1
sound/usb/usbaudio.h
··· 8 8 */ 9 9 10 10 /* handling of USB vendor/product ID pairs as 32-bit numbers */ 11 - #define USB_ID(vendor, product) (((vendor) << 16) | (product)) 11 + #define USB_ID(vendor, product) (((unsigned int)(vendor) << 16) | (product)) 12 12 #define USB_ID_VENDOR(id) ((id) >> 16) 13 13 #define USB_ID_PRODUCT(id) ((u16)(id)) 14 14
+6 -1
sound/x86/intel_hdmi_audio.c
··· 1652 1652 * This function is called when the i915 driver creates the 1653 1653 * hdmi-lpe-audio platform device. 1654 1654 */ 1655 - static int hdmi_lpe_audio_probe(struct platform_device *pdev) 1655 + static int __hdmi_lpe_audio_probe(struct platform_device *pdev) 1656 1656 { 1657 1657 struct snd_card *card; 1658 1658 struct snd_intelhad_card *card_ctx; ··· 1813 1813 } 1814 1814 1815 1815 return 0; 1816 + } 1817 + 1818 + static int hdmi_lpe_audio_probe(struct platform_device *pdev) 1819 + { 1820 + return snd_card_free_on_error(&pdev->dev, __hdmi_lpe_audio_probe(pdev)); 1816 1821 } 1817 1822 1818 1823 static const struct dev_pm_ops hdmi_lpe_audio_pm = {