From: kernel test robot <lkp@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: sound/core/compress_offload.c:595:6-12: inconsistent IS_ERR and PTR_ERR on line 596.
Date: Fri, 15 Mar 2024 18:30:26 +0800 [thread overview]
Message-ID: <202403151855.V0OS6L14-lkp@intel.com> (raw)
Hi Takashi,
FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e5eb28f6d1afebed4bb7d740a797d0390bd3a357
commit: 9b02221422a55e834469fdc91dc4d5147f5a1fb9 ALSA: compress_offload: Use automatic cleanup of kfree()
date: 3 weeks ago
config: x86_64-randconfig-103-20240314 (https://download.01.org/0day-ci/archive/20240315/202403151855.V0OS6L14-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403151855.V0OS6L14-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> sound/core/compress_offload.c:595:6-12: inconsistent IS_ERR and PTR_ERR on line 596.
vim +595 sound/core/compress_offload.c
4dc040a0b34890 Vinod Koul 2012-09-17 582
b21c60a4edd22e Vinod Koul 2011-12-23 583 static int
b21c60a4edd22e Vinod Koul 2011-12-23 584 snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg)
b21c60a4edd22e Vinod Koul 2011-12-23 585 {
9b02221422a55e Takashi Iwai 2024-02-22 586 struct snd_compr_params *params __free(kfree) = NULL;
b21c60a4edd22e Vinod Koul 2011-12-23 587 int retval;
b21c60a4edd22e Vinod Koul 2011-12-23 588
7ea9ee0064281e Srinivas Kandagatla 2023-06-19 589 if (stream->runtime->state == SNDRV_PCM_STATE_OPEN || stream->next_track) {
b21c60a4edd22e Vinod Koul 2011-12-23 590 /*
b21c60a4edd22e Vinod Koul 2011-12-23 591 * we should allow parameter change only when stream has been
b21c60a4edd22e Vinod Koul 2011-12-23 592 * opened not in other cases
b21c60a4edd22e Vinod Koul 2011-12-23 593 */
c2f14ba749c1ce Markus Elfring 2016-08-21 594 params = memdup_user((void __user *)arg, sizeof(*params));
c2f14ba749c1ce Markus Elfring 2016-08-21 @595 if (IS_ERR(params))
9b02221422a55e Takashi Iwai 2024-02-22 @596 return PTR_ERR(no_free_ptr(params));
4dc040a0b34890 Vinod Koul 2012-09-17 597
4dc040a0b34890 Vinod Koul 2012-09-17 598 retval = snd_compress_check_input(params);
4dc040a0b34890 Vinod Koul 2012-09-17 599 if (retval)
9b02221422a55e Takashi Iwai 2024-02-22 600 return retval;
4dc040a0b34890 Vinod Koul 2012-09-17 601
b21c60a4edd22e Vinod Koul 2011-12-23 602 retval = snd_compr_allocate_buffer(stream, params);
9b02221422a55e Takashi Iwai 2024-02-22 603 if (retval)
9b02221422a55e Takashi Iwai 2024-02-22 604 return -ENOMEM;
4dc040a0b34890 Vinod Koul 2012-09-17 605
b21c60a4edd22e Vinod Koul 2011-12-23 606 retval = stream->ops->set_params(stream, params);
b21c60a4edd22e Vinod Koul 2011-12-23 607 if (retval)
9b02221422a55e Takashi Iwai 2024-02-22 608 return retval;
49bb6402f1aa1e Charles Keepax 2013-04-18 609
7ea9ee0064281e Srinivas Kandagatla 2023-06-19 610 if (stream->next_track)
9b02221422a55e Takashi Iwai 2024-02-22 611 return retval;
7ea9ee0064281e Srinivas Kandagatla 2023-06-19 612
9727b490e543de Jeeja KP 2013-02-14 613 stream->metadata_set = false;
9727b490e543de Jeeja KP 2013-02-14 614 stream->next_track = false;
49bb6402f1aa1e Charles Keepax 2013-04-18 615
49bb6402f1aa1e Charles Keepax 2013-04-18 616 stream->runtime->state = SNDRV_PCM_STATE_SETUP;
769fab2a41da4b Jesper Juhl 2012-01-23 617 } else {
b21c60a4edd22e Vinod Koul 2011-12-23 618 return -EPERM;
769fab2a41da4b Jesper Juhl 2012-01-23 619 }
b21c60a4edd22e Vinod Koul 2011-12-23 620 return retval;
b21c60a4edd22e Vinod Koul 2011-12-23 621 }
b21c60a4edd22e Vinod Koul 2011-12-23 622
:::::: The code at line 595 was first introduced by commit
:::::: c2f14ba749c1ce94aa97c5a84733a89aaaadada4 ALSA: compress: Use memdup_user() rather than duplicating its implementation
:::::: TO: Markus Elfring <elfring@users.sourceforge.net>
:::::: CC: Takashi Iwai <tiwai@suse.de>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-03-15 10:31 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=202403151855.V0OS6L14-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tiwai@suse.de \
/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.