CC: [email protected]
CC: Linux Memory Management List <[email protected]>
TO: Takashi Iwai <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   7636510f976d75b860848884169ba985c8f844d8
commit: 0e175f665960c7be30aba47afbee4f2d121ea5fc [1590/10320] ALSA: als4000: 
Allocate resources with device-managed APIs
:::::: branch date: 3 hours ago
:::::: commit date: 5 weeks ago
config: x86_64-randconfig-m001-20210825 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
sound/pci/als4000.c:930 snd_card_als4000_probe() warn: 'pci' not released on 
lines: 852,872.

vim +/pci +930 sound/pci/als4000.c

^1da177e4c3f415 Linus Torvalds  2005-04-16  808  
e23e7a143620721 Bill Pemberton  2012-12-06  809  static int 
snd_card_als4000_probe(struct pci_dev *pci,
^1da177e4c3f415 Linus Torvalds  2005-04-16  810                                 
  const struct pci_device_id *pci_id)
^1da177e4c3f415 Linus Torvalds  2005-04-16  811  {
^1da177e4c3f415 Linus Torvalds  2005-04-16  812         static int dev;
17c39d9a59cbf4b Takashi Iwai    2005-11-17  813         struct snd_card *card;
17c39d9a59cbf4b Takashi Iwai    2005-11-17  814         struct snd_card_als4000 
*acard;
c08744498491759 Andreas Mohr    2008-08-20  815         unsigned long iobase;
17c39d9a59cbf4b Takashi Iwai    2005-11-17  816         struct snd_sb *chip;
17c39d9a59cbf4b Takashi Iwai    2005-11-17  817         struct snd_opl3 *opl3;
^1da177e4c3f415 Linus Torvalds  2005-04-16  818         unsigned short word;
^1da177e4c3f415 Linus Torvalds  2005-04-16  819         int err;
^1da177e4c3f415 Linus Torvalds  2005-04-16  820  
^1da177e4c3f415 Linus Torvalds  2005-04-16  821         if (dev >= SNDRV_CARDS)
^1da177e4c3f415 Linus Torvalds  2005-04-16  822                 return -ENODEV;
^1da177e4c3f415 Linus Torvalds  2005-04-16  823         if (!enable[dev]) {
^1da177e4c3f415 Linus Torvalds  2005-04-16  824                 dev++;
^1da177e4c3f415 Linus Torvalds  2005-04-16  825                 return -ENOENT;
^1da177e4c3f415 Linus Torvalds  2005-04-16  826         }
^1da177e4c3f415 Linus Torvalds  2005-04-16  827  
^1da177e4c3f415 Linus Torvalds  2005-04-16  828         /* enable PCI device */
0e175f665960c7b Takashi Iwai    2021-07-15  829         err = 
pcim_enable_device(pci);
61ea06e8a881631 Takashi Iwai    2021-06-08  830         if (err < 0)
^1da177e4c3f415 Linus Torvalds  2005-04-16  831                 return err;
61ea06e8a881631 Takashi Iwai    2021-06-08  832  
^1da177e4c3f415 Linus Torvalds  2005-04-16  833         /* check, if we can 
restrict PCI DMA transfers to 24 bits */
669f65eaeb969ef Takashi Iwai    2021-01-14  834         if 
(dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(24))) {
d85d878efb30477 Takashi Iwai    2014-02-25  835                 
dev_err(&pci->dev, "architecture does not support 24bit PCI busmaster DMA\n");
^1da177e4c3f415 Linus Torvalds  2005-04-16  836                 return -ENXIO;
^1da177e4c3f415 Linus Torvalds  2005-04-16  837         }
^1da177e4c3f415 Linus Torvalds  2005-04-16  838  
61ea06e8a881631 Takashi Iwai    2021-06-08  839         err = 
pci_request_regions(pci, "ALS4000");
0e175f665960c7b Takashi Iwai    2021-07-15  840         if (err < 0)
^1da177e4c3f415 Linus Torvalds  2005-04-16  841                 return err;
c08744498491759 Andreas Mohr    2008-08-20  842         iobase = 
pci_resource_start(pci, 0);
^1da177e4c3f415 Linus Torvalds  2005-04-16  843  
^1da177e4c3f415 Linus Torvalds  2005-04-16  844         
pci_read_config_word(pci, PCI_COMMAND, &word);
^1da177e4c3f415 Linus Torvalds  2005-04-16  845         
pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
^1da177e4c3f415 Linus Torvalds  2005-04-16  846         pci_set_master(pci);
^1da177e4c3f415 Linus Torvalds  2005-04-16  847         
0e175f665960c7b Takashi Iwai    2021-07-15  848         err = 
snd_devm_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
e58de7baf7de11f Takashi Iwai    2008-12-28  849                                 
sizeof(*acard) /* private_data: acard */,
e58de7baf7de11f Takashi Iwai    2008-12-28  850                                 
&card);
0e175f665960c7b Takashi Iwai    2021-07-15  851         if (err < 0)
e58de7baf7de11f Takashi Iwai    2008-12-28  852                 return err;
^1da177e4c3f415 Linus Torvalds  2005-04-16  853  
c08744498491759 Andreas Mohr    2008-08-20  854         acard = 
card->private_data;
^1da177e4c3f415 Linus Torvalds  2005-04-16  855         acard->pci = pci;
c08744498491759 Andreas Mohr    2008-08-20  856         acard->iobase = iobase;
^1da177e4c3f415 Linus Torvalds  2005-04-16  857         card->private_free = 
snd_card_als4000_free;
^1da177e4c3f415 Linus Torvalds  2005-04-16  858  
^1da177e4c3f415 Linus Torvalds  2005-04-16  859         /* disable all legacy 
ISA stuff */
c08744498491759 Andreas Mohr    2008-08-20  860         
snd_als4000_set_addr(acard->iobase, 0, 0, 0, 0);
^1da177e4c3f415 Linus Torvalds  2005-04-16  861  
61ea06e8a881631 Takashi Iwai    2021-06-08  862         err = 
snd_sbdsp_create(card,
c08744498491759 Andreas Mohr    2008-08-20  863                                
iobase + ALS4K_IOB_10_ADLIB_ADDR0,
^1da177e4c3f415 Linus Torvalds  2005-04-16  864                                
pci->irq,
cb780cdd85b8ae4 Andreas Mohr    2008-08-21  865                 /* internally 
registered as IRQF_SHARED in case of ALS4000 SB */
^1da177e4c3f415 Linus Torvalds  2005-04-16  866                                
snd_als4000_interrupt,
^1da177e4c3f415 Linus Torvalds  2005-04-16  867                                
-1,
^1da177e4c3f415 Linus Torvalds  2005-04-16  868                                
-1,
^1da177e4c3f415 Linus Torvalds  2005-04-16  869                                
SB_HW_ALS4000,
61ea06e8a881631 Takashi Iwai    2021-06-08  870                                
&chip);
61ea06e8a881631 Takashi Iwai    2021-06-08  871         if (err < 0)
0e175f665960c7b Takashi Iwai    2021-07-15  872                 return err;
703529140cfb774 Takashi Iwai    2005-11-17  873         acard->chip = chip;
^1da177e4c3f415 Linus Torvalds  2005-04-16  874  
^1da177e4c3f415 Linus Torvalds  2005-04-16  875         chip->pci = pci;
c08744498491759 Andreas Mohr    2008-08-20  876         chip->alt_port = iobase;
^1da177e4c3f415 Linus Torvalds  2005-04-16  877  
^1da177e4c3f415 Linus Torvalds  2005-04-16  878         
snd_als4000_configure(chip);
^1da177e4c3f415 Linus Torvalds  2005-04-16  879  
^1da177e4c3f415 Linus Torvalds  2005-04-16  880         strcpy(card->driver, 
"ALS4000");
^1da177e4c3f415 Linus Torvalds  2005-04-16  881         strcpy(card->shortname, 
"Avance Logic ALS4000");
^1da177e4c3f415 Linus Torvalds  2005-04-16  882         sprintf(card->longname, 
"%s at 0x%lx, irq %i",
^1da177e4c3f415 Linus Torvalds  2005-04-16  883                 
card->shortname, chip->alt_port, chip->irq);
^1da177e4c3f415 Linus Torvalds  2005-04-16  884  
61ea06e8a881631 Takashi Iwai    2021-06-08  885         err = 
snd_mpu401_uart_new(card, 0, MPU401_HW_ALS4000,
c08744498491759 Andreas Mohr    2008-08-20  886                                 
  iobase + ALS4K_IOB_30_MIDI_DATA,
dba8b46992c5594 Clemens Ladisch 2011-09-13  887                                 
  MPU401_INFO_INTEGRATED |
dba8b46992c5594 Clemens Ladisch 2011-09-13  888                                 
  MPU401_INFO_IRQ_HOOK,
61ea06e8a881631 Takashi Iwai    2021-06-08  889                                 
  -1, &chip->rmidi);
61ea06e8a881631 Takashi Iwai    2021-06-08  890         if (err < 0) {
d85d878efb30477 Takashi Iwai    2014-02-25  891                 
dev_err(&pci->dev, "no MPU-401 device at 0x%lx?\n",
c08744498491759 Andreas Mohr    2008-08-20  892                                 
iobase + ALS4K_IOB_30_MIDI_DATA);
0e175f665960c7b Takashi Iwai    2021-07-15  893                 return err;
^1da177e4c3f415 Linus Torvalds  2005-04-16  894         }
c08744498491759 Andreas Mohr    2008-08-20  895         /* FIXME: ALS4000 has 
interesting MPU401 configuration features
cb780cdd85b8ae4 Andreas Mohr    2008-08-21  896          * at 
ALS4K_CR1A_MPU401_UART_MODE_CONTROL
cb780cdd85b8ae4 Andreas Mohr    2008-08-21  897          * (pass-thru / UART 
switching, fast MIDI clock, etc.),
cb780cdd85b8ae4 Andreas Mohr    2008-08-21  898          * however there 
doesn't seem to be an ALSA API for this...
cb780cdd85b8ae4 Andreas Mohr    2008-08-21  899          * SPECS_PAGE: 21 */
^1da177e4c3f415 Linus Torvalds  2005-04-16  900  
61ea06e8a881631 Takashi Iwai    2021-06-08  901         err = 
snd_als4000_pcm(chip, 0);
61ea06e8a881631 Takashi Iwai    2021-06-08  902         if (err < 0)
0e175f665960c7b Takashi Iwai    2021-07-15  903                 return err;
61ea06e8a881631 Takashi Iwai    2021-06-08  904  
61ea06e8a881631 Takashi Iwai    2021-06-08  905         err = 
snd_sbmixer_new(chip);
61ea06e8a881631 Takashi Iwai    2021-06-08  906         if (err < 0)
0e175f665960c7b Takashi Iwai    2021-07-15  907                 return err;
^1da177e4c3f415 Linus Torvalds  2005-04-16  908  
c08744498491759 Andreas Mohr    2008-08-20  909         if 
(snd_opl3_create(card,
c08744498491759 Andreas Mohr    2008-08-20  910                                 
iobase + ALS4K_IOB_10_ADLIB_ADDR0,
c08744498491759 Andreas Mohr    2008-08-20  911                                 
iobase + ALS4K_IOB_12_ADLIB_ADDR2,
^1da177e4c3f415 Linus Torvalds  2005-04-16  912                             
OPL3_HW_AUTO, 1, &opl3) < 0) {
d85d878efb30477 Takashi Iwai    2014-02-25  913                 
dev_err(&pci->dev, "no OPL device at 0x%lx-0x%lx?\n",
c08744498491759 Andreas Mohr    2008-08-20  914                            
iobase + ALS4K_IOB_10_ADLIB_ADDR0,
c08744498491759 Andreas Mohr    2008-08-20  915                            
iobase + ALS4K_IOB_12_ADLIB_ADDR2);
^1da177e4c3f415 Linus Torvalds  2005-04-16  916         } else {
61ea06e8a881631 Takashi Iwai    2021-06-08  917                 err = 
snd_opl3_hwdep_new(opl3, 0, 1, NULL);
61ea06e8a881631 Takashi Iwai    2021-06-08  918                 if (err < 0)
0e175f665960c7b Takashi Iwai    2021-07-15  919                         return 
err;
^1da177e4c3f415 Linus Torvalds  2005-04-16  920         }
^1da177e4c3f415 Linus Torvalds  2005-04-16  921  
^1da177e4c3f415 Linus Torvalds  2005-04-16  922         
snd_als4000_create_gameport(acard, dev);
^1da177e4c3f415 Linus Torvalds  2005-04-16  923  
61ea06e8a881631 Takashi Iwai    2021-06-08  924         err = 
snd_card_register(card);
61ea06e8a881631 Takashi Iwai    2021-06-08  925         if (err < 0)
0e175f665960c7b Takashi Iwai    2021-07-15  926                 return err;
61ea06e8a881631 Takashi Iwai    2021-06-08  927  
^1da177e4c3f415 Linus Torvalds  2005-04-16  928         pci_set_drvdata(pci, 
card);
^1da177e4c3f415 Linus Torvalds  2005-04-16  929         dev++;
0e175f665960c7b Takashi Iwai    2021-07-15 @930         return 0;
^1da177e4c3f415 Linus Torvalds  2005-04-16  931  }
^1da177e4c3f415 Linus Torvalds  2005-04-16  932  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to