* [linux-next:master 615/2355] sound/virtio/virtio_pcm.c:438 virtsnd_pcm_build_devs() warn: passing a valid pointer to 'PTR_ERR'
@ 2021-03-05 8:01 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-05 8:01 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 5874 bytes --]
CC: kbuild-all(a)01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Anton Yakovlev <anton.yakovlev@opensynergy.com>
CC: "Michael S. Tsirkin" <mst@redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 4641b32307b3b54397652a71f852bb0bafb0820d
commit: 83ec5db56076d6be459a070b3f0a15d53dbed9b0 [615/2355] ALSA: virtio: build PCM devices and substream hardware descriptors
:::::: branch date: 4 hours ago
:::::: commit date: 8 days ago
config: parisc-randconfig-m031-20210305 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.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/virtio/virtio_pcm.c:438 virtsnd_pcm_build_devs() warn: passing a valid pointer to 'PTR_ERR'
vim +/PTR_ERR +438 sound/virtio/virtio_pcm.c
83ec5db56076d6b Anton Yakovlev 2021-02-22 375
83ec5db56076d6b Anton Yakovlev 2021-02-22 376 /**
83ec5db56076d6b Anton Yakovlev 2021-02-22 377 * virtsnd_pcm_build_devs() - Build ALSA PCM devices.
83ec5db56076d6b Anton Yakovlev 2021-02-22 378 * @snd: VirtIO sound device.
83ec5db56076d6b Anton Yakovlev 2021-02-22 379 *
83ec5db56076d6b Anton Yakovlev 2021-02-22 380 * Context: Any context that permits to sleep.
83ec5db56076d6b Anton Yakovlev 2021-02-22 381 * Return: 0 on success, -errno on failure.
83ec5db56076d6b Anton Yakovlev 2021-02-22 382 */
83ec5db56076d6b Anton Yakovlev 2021-02-22 383 int virtsnd_pcm_build_devs(struct virtio_snd *snd)
83ec5db56076d6b Anton Yakovlev 2021-02-22 384 {
83ec5db56076d6b Anton Yakovlev 2021-02-22 385 struct virtio_device *vdev = snd->vdev;
83ec5db56076d6b Anton Yakovlev 2021-02-22 386 struct virtio_pcm *vpcm;
83ec5db56076d6b Anton Yakovlev 2021-02-22 387 u32 i;
83ec5db56076d6b Anton Yakovlev 2021-02-22 388 int rc;
83ec5db56076d6b Anton Yakovlev 2021-02-22 389
83ec5db56076d6b Anton Yakovlev 2021-02-22 390 list_for_each_entry(vpcm, &snd->pcm_list, list) {
83ec5db56076d6b Anton Yakovlev 2021-02-22 391 unsigned int npbs =
83ec5db56076d6b Anton Yakovlev 2021-02-22 392 vpcm->streams[SNDRV_PCM_STREAM_PLAYBACK].nsubstreams;
83ec5db56076d6b Anton Yakovlev 2021-02-22 393 unsigned int ncps =
83ec5db56076d6b Anton Yakovlev 2021-02-22 394 vpcm->streams[SNDRV_PCM_STREAM_CAPTURE].nsubstreams;
83ec5db56076d6b Anton Yakovlev 2021-02-22 395
83ec5db56076d6b Anton Yakovlev 2021-02-22 396 if (!npbs && !ncps)
83ec5db56076d6b Anton Yakovlev 2021-02-22 397 continue;
83ec5db56076d6b Anton Yakovlev 2021-02-22 398
83ec5db56076d6b Anton Yakovlev 2021-02-22 399 rc = snd_pcm_new(snd->card, VIRTIO_SND_CARD_DRIVER, vpcm->nid,
83ec5db56076d6b Anton Yakovlev 2021-02-22 400 npbs, ncps, &vpcm->pcm);
83ec5db56076d6b Anton Yakovlev 2021-02-22 401 if (rc) {
83ec5db56076d6b Anton Yakovlev 2021-02-22 402 dev_err(&vdev->dev, "snd_pcm_new[%u] failed: %d\n",
83ec5db56076d6b Anton Yakovlev 2021-02-22 403 vpcm->nid, rc);
83ec5db56076d6b Anton Yakovlev 2021-02-22 404 return rc;
83ec5db56076d6b Anton Yakovlev 2021-02-22 405 }
83ec5db56076d6b Anton Yakovlev 2021-02-22 406
83ec5db56076d6b Anton Yakovlev 2021-02-22 407 vpcm->pcm->info_flags = 0;
83ec5db56076d6b Anton Yakovlev 2021-02-22 408 vpcm->pcm->dev_class = SNDRV_PCM_CLASS_GENERIC;
83ec5db56076d6b Anton Yakovlev 2021-02-22 409 vpcm->pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX;
83ec5db56076d6b Anton Yakovlev 2021-02-22 410 snprintf(vpcm->pcm->name, sizeof(vpcm->pcm->name),
83ec5db56076d6b Anton Yakovlev 2021-02-22 411 VIRTIO_SND_PCM_NAME " %u", vpcm->pcm->device);
83ec5db56076d6b Anton Yakovlev 2021-02-22 412 vpcm->pcm->private_data = vpcm;
83ec5db56076d6b Anton Yakovlev 2021-02-22 413 vpcm->pcm->nonatomic = true;
83ec5db56076d6b Anton Yakovlev 2021-02-22 414
83ec5db56076d6b Anton Yakovlev 2021-02-22 415 for (i = 0; i < ARRAY_SIZE(vpcm->streams); ++i) {
83ec5db56076d6b Anton Yakovlev 2021-02-22 416 struct virtio_pcm_stream *stream = &vpcm->streams[i];
83ec5db56076d6b Anton Yakovlev 2021-02-22 417
83ec5db56076d6b Anton Yakovlev 2021-02-22 418 if (!stream->nsubstreams)
83ec5db56076d6b Anton Yakovlev 2021-02-22 419 continue;
83ec5db56076d6b Anton Yakovlev 2021-02-22 420
83ec5db56076d6b Anton Yakovlev 2021-02-22 421 stream->substreams =
83ec5db56076d6b Anton Yakovlev 2021-02-22 422 devm_kcalloc(&vdev->dev, stream->nsubstreams,
83ec5db56076d6b Anton Yakovlev 2021-02-22 423 sizeof(*stream->substreams),
83ec5db56076d6b Anton Yakovlev 2021-02-22 424 GFP_KERNEL);
83ec5db56076d6b Anton Yakovlev 2021-02-22 425 if (!stream->substreams)
83ec5db56076d6b Anton Yakovlev 2021-02-22 426 return -ENOMEM;
83ec5db56076d6b Anton Yakovlev 2021-02-22 427
83ec5db56076d6b Anton Yakovlev 2021-02-22 428 stream->nsubstreams = 0;
83ec5db56076d6b Anton Yakovlev 2021-02-22 429 }
83ec5db56076d6b Anton Yakovlev 2021-02-22 430 }
83ec5db56076d6b Anton Yakovlev 2021-02-22 431
83ec5db56076d6b Anton Yakovlev 2021-02-22 432 for (i = 0; i < snd->nsubstreams; ++i) {
83ec5db56076d6b Anton Yakovlev 2021-02-22 433 struct virtio_pcm_stream *vs;
83ec5db56076d6b Anton Yakovlev 2021-02-22 434 struct virtio_pcm_substream *vss = &snd->substreams[i];
83ec5db56076d6b Anton Yakovlev 2021-02-22 435
83ec5db56076d6b Anton Yakovlev 2021-02-22 436 vpcm = virtsnd_pcm_find(snd, vss->nid);
83ec5db56076d6b Anton Yakovlev 2021-02-22 437 if (IS_ERR(vpcm))
83ec5db56076d6b Anton Yakovlev 2021-02-22 @438 return PTR_ERR(vpcm);
---
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: 34286 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-05 8:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-05 8:01 [linux-next:master 615/2355] sound/virtio/virtio_pcm.c:438 virtsnd_pcm_build_devs() warn: passing a valid pointer to 'PTR_ERR' kernel test robot
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.