From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [linux-next:master 1783/3296] sound/pci/emu10k1/emu10k1x.c:960 snd_emu10k1x_create() warn: 'pci' not released on lines: 895, 904.
Date: Mon, 26 Jul 2021 22:54:51 +0800 [thread overview]
Message-ID: <202107262240.HvTwQGDO-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 9602 bytes --]
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Takashi Iwai <tiwai@suse.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 90d856e71443a2fcacca8e7539bac44d9cb3f7ab
commit: 2b377c6b6012b6ae71ae74d0b14677050a5aaf6c [1783/3296] ALSA: emu10k1x: Allocate resources with device-managed APIs
:::::: branch date: 3 days ago
:::::: commit date: 7 days ago
config: x86_64-randconfig-m001-20210726 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
sound/pci/emu10k1/emu10k1x.c:960 snd_emu10k1x_create() warn: 'pci' not released on lines: 895,904.
vim +/pci +960 sound/pci/emu10k1/emu10k1x.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 863
e23e7a14362072 Bill Pemberton 2012-12-06 864 static int snd_emu10k1x_create(struct snd_card *card,
2b377c6b6012b6 Takashi Iwai 2021-07-15 865 struct pci_dev *pci)
^1da177e4c3f41 Linus Torvalds 2005-04-16 866 {
2b377c6b6012b6 Takashi Iwai 2021-07-15 867 struct emu10k1x *chip = card->private_data;
^1da177e4c3f41 Linus Torvalds 2005-04-16 868 int err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 869 int ch;
^1da177e4c3f41 Linus Torvalds 2005-04-16 870
2b377c6b6012b6 Takashi Iwai 2021-07-15 871 err = pcim_enable_device(pci);
9031f93851bc47 Takashi Iwai 2021-06-08 872 if (err < 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 873 return err;
9ac05523d38d4c Christophe JAILLET 2020-11-21 874
9ac05523d38d4c Christophe JAILLET 2020-11-21 875 if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(28)) < 0) {
26bc6964f97b3a Takashi Iwai 2014-02-25 876 dev_err(card->dev, "error to set 28bit mask DMA\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 877 return -ENXIO;
^1da177e4c3f41 Linus Torvalds 2005-04-16 878 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 879
^1da177e4c3f41 Linus Torvalds 2005-04-16 880 chip->card = card;
^1da177e4c3f41 Linus Torvalds 2005-04-16 881 chip->pci = pci;
^1da177e4c3f41 Linus Torvalds 2005-04-16 882 chip->irq = -1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 883
^1da177e4c3f41 Linus Torvalds 2005-04-16 884 spin_lock_init(&chip->emu_lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 885 spin_lock_init(&chip->voice_lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 886
2b377c6b6012b6 Takashi Iwai 2021-07-15 887 err = pci_request_regions(pci, "EMU10K1X");
2b377c6b6012b6 Takashi Iwai 2021-07-15 888 if (err < 0)
2b377c6b6012b6 Takashi Iwai 2021-07-15 889 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 890 chip->port = pci_resource_start(pci, 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 891
2b377c6b6012b6 Takashi Iwai 2021-07-15 892 if (devm_request_irq(&pci->dev, pci->irq, snd_emu10k1x_interrupt,
934c2b6d0cb50f Takashi Iwai 2011-06-10 893 IRQF_SHARED, KBUILD_MODNAME, chip)) {
26bc6964f97b3a Takashi Iwai 2014-02-25 894 dev_err(card->dev, "cannot grab irq %d\n", pci->irq);
^1da177e4c3f41 Linus Torvalds 2005-04-16 895 return -EBUSY;
^1da177e4c3f41 Linus Torvalds 2005-04-16 896 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 897 chip->irq = pci->irq;
66471aa715f0d4 Takashi Iwai 2019-12-10 898 card->sync_irq = chip->irq;
2b377c6b6012b6 Takashi Iwai 2021-07-15 899 card->private_free = snd_emu10k1x_free;
^1da177e4c3f41 Linus Torvalds 2005-04-16 900
2b377c6b6012b6 Takashi Iwai 2021-07-15 901 chip->dma_buffer = snd_devm_alloc_pages(&pci->dev, SNDRV_DMA_TYPE_DEV,
2b377c6b6012b6 Takashi Iwai 2021-07-15 902 4 * 1024);
2b377c6b6012b6 Takashi Iwai 2021-07-15 903 if (!chip->dma_buffer)
^1da177e4c3f41 Linus Torvalds 2005-04-16 904 return -ENOMEM;
^1da177e4c3f41 Linus Torvalds 2005-04-16 905
^1da177e4c3f41 Linus Torvalds 2005-04-16 906 pci_set_master(pci);
^1da177e4c3f41 Linus Torvalds 2005-04-16 907 /* read revision & serial */
44c10138fd4bbc Auke Kok 2007-06-08 908 chip->revision = pci->revision;
^1da177e4c3f41 Linus Torvalds 2005-04-16 909 pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial);
^1da177e4c3f41 Linus Torvalds 2005-04-16 910 pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model);
26bc6964f97b3a Takashi Iwai 2014-02-25 911 dev_info(card->dev, "Model %04x Rev %08x Serial %08x\n", chip->model,
^1da177e4c3f41 Linus Torvalds 2005-04-16 912 chip->revision, chip->serial);
^1da177e4c3f41 Linus Torvalds 2005-04-16 913
^1da177e4c3f41 Linus Torvalds 2005-04-16 914 outl(0, chip->port + INTE);
^1da177e4c3f41 Linus Torvalds 2005-04-16 915
^1da177e4c3f41 Linus Torvalds 2005-04-16 916 for(ch = 0; ch < 3; ch++) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 917 chip->voices[ch].emu = chip;
^1da177e4c3f41 Linus Torvalds 2005-04-16 918 chip->voices[ch].number = ch;
^1da177e4c3f41 Linus Torvalds 2005-04-16 919 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 920
^1da177e4c3f41 Linus Torvalds 2005-04-16 921 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 922 * Init to 0x02109204 :
^1da177e4c3f41 Linus Torvalds 2005-04-16 923 * Clock accuracy = 0 (1000ppm)
^1da177e4c3f41 Linus Torvalds 2005-04-16 924 * Sample Rate = 2 (48kHz)
^1da177e4c3f41 Linus Torvalds 2005-04-16 925 * Audio Channel = 1 (Left of 2)
^1da177e4c3f41 Linus Torvalds 2005-04-16 926 * Source Number = 0 (Unspecified)
^1da177e4c3f41 Linus Torvalds 2005-04-16 927 * Generation Status = 1 (Original for Cat Code 12)
^1da177e4c3f41 Linus Torvalds 2005-04-16 928 * Cat Code = 12 (Digital Signal Mixer)
^1da177e4c3f41 Linus Torvalds 2005-04-16 929 * Mode = 0 (Mode 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 930 * Emphasis = 0 (None)
^1da177e4c3f41 Linus Torvalds 2005-04-16 931 * CP = 1 (Copyright unasserted)
^1da177e4c3f41 Linus Torvalds 2005-04-16 932 * AN = 0 (Audio data)
^1da177e4c3f41 Linus Torvalds 2005-04-16 933 * P = 0 (Consumer)
^1da177e4c3f41 Linus Torvalds 2005-04-16 934 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 935 snd_emu10k1x_ptr_write(chip, SPCS0, 0,
^1da177e4c3f41 Linus Torvalds 2005-04-16 936 chip->spdif_bits[0] =
^1da177e4c3f41 Linus Torvalds 2005-04-16 937 SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
^1da177e4c3f41 Linus Torvalds 2005-04-16 938 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
^1da177e4c3f41 Linus Torvalds 2005-04-16 939 SPCS_GENERATIONSTATUS | 0x00001200 |
^1da177e4c3f41 Linus Torvalds 2005-04-16 940 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
^1da177e4c3f41 Linus Torvalds 2005-04-16 941 snd_emu10k1x_ptr_write(chip, SPCS1, 0,
^1da177e4c3f41 Linus Torvalds 2005-04-16 942 chip->spdif_bits[1] =
^1da177e4c3f41 Linus Torvalds 2005-04-16 943 SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
^1da177e4c3f41 Linus Torvalds 2005-04-16 944 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
^1da177e4c3f41 Linus Torvalds 2005-04-16 945 SPCS_GENERATIONSTATUS | 0x00001200 |
^1da177e4c3f41 Linus Torvalds 2005-04-16 946 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
^1da177e4c3f41 Linus Torvalds 2005-04-16 947 snd_emu10k1x_ptr_write(chip, SPCS2, 0,
^1da177e4c3f41 Linus Torvalds 2005-04-16 948 chip->spdif_bits[2] =
^1da177e4c3f41 Linus Torvalds 2005-04-16 949 SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
^1da177e4c3f41 Linus Torvalds 2005-04-16 950 SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
^1da177e4c3f41 Linus Torvalds 2005-04-16 951 SPCS_GENERATIONSTATUS | 0x00001200 |
^1da177e4c3f41 Linus Torvalds 2005-04-16 952 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
^1da177e4c3f41 Linus Torvalds 2005-04-16 953
^1da177e4c3f41 Linus Torvalds 2005-04-16 954 snd_emu10k1x_ptr_write(chip, SPDIF_SELECT, 0, 0x700); // disable SPDIF
^1da177e4c3f41 Linus Torvalds 2005-04-16 955 snd_emu10k1x_ptr_write(chip, ROUTING, 0, 0x1003F); // routing
^1da177e4c3f41 Linus Torvalds 2005-04-16 956 snd_emu10k1x_gpio_write(chip, 0x1080); // analog mode
^1da177e4c3f41 Linus Torvalds 2005-04-16 957
^1da177e4c3f41 Linus Torvalds 2005-04-16 958 outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG);
^1da177e4c3f41 Linus Torvalds 2005-04-16 959
^1da177e4c3f41 Linus Torvalds 2005-04-16 @960 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 961 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 962
:::::: The code at line 960 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37509 bytes --]
reply other threads:[~2021-07-26 14:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202107262240.HvTwQGDO-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.