All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: [drm-drm-intel:drm-intel-next-queued 9/12] drivers/gpu/drm/i915/i915_perf.c:386 i915_oa_config_release() warn: passing zero to 'PTR_ERR'
Date: Sun, 13 Oct 2019 12:23:14 +0300	[thread overview]
Message-ID: <20191013092152.GW13286@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 2929 bytes --]

tree:   git://anongit.freedesktop.org/drm/drm-intel drm-intel-next-queued
head:   5f5c382ecfdd06e17316d1c9f1362522c20cdfef
commit: 6a45008ab7bb5e13b543de0c141b94aaa71d8397 [9/12] drm/i915/perf: allow for CS OA configs to be created lazily

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/gpu/drm/i915/i915_perf.c:386 i915_oa_config_release() warn: passing zero to 'PTR_ERR'

Old smatch warnings:
drivers/gpu/drm/i915/i915_perf.c:388 i915_oa_config_release() warn: passing zero to 'PTR_ERR'
drivers/gpu/drm/i915/i915_perf.c:390 i915_oa_config_release() warn: passing zero to 'PTR_ERR'
drivers/gpu/drm/i915/i915_perf.c:3420 i915_perf_add_config_ioctl() error: double unlock 'mutex:&perf->metrics_lock'
drivers/gpu/drm/i915/i915_perf.c:3427 i915_perf_add_config_ioctl() error: double unlock 'mutex:&perf->metrics_lock'
drivers/gpu/drm/i915/i915_perf.c:3481 i915_perf_remove_config_ioctl() error: double unlock 'mutex:&perf->metrics_lock'
drivers/gpu/drm/i915/i915_perf.c:3490 i915_perf_remove_config_ioctl() error: double unlock 'mutex:&perf->metrics_lock'

git remote add drm-drm-intel git://anongit.freedesktop.org/drm/drm-intel
git remote update drm-drm-intel
git checkout 6a45008ab7bb5e13b543de0c141b94aaa71d8397
vim +/PTR_ERR +386 drivers/gpu/drm/i915/i915_perf.c

6a45008ab7bb5e Lionel Landwerlin     2019-10-12  381  void i915_oa_config_release(struct kref *ref)
f89823c212246d Lionel Landwerlin     2017-08-03  382  {
6a45008ab7bb5e Lionel Landwerlin     2019-10-12  383  	struct i915_oa_config *oa_config =
6a45008ab7bb5e Lionel Landwerlin     2019-10-12  384  		container_of(ref, typeof(*oa_config), ref);
6a45008ab7bb5e Lionel Landwerlin     2019-10-12  385  
f89823c212246d Lionel Landwerlin     2017-08-03 @386  	if (!PTR_ERR(oa_config->flex_regs))

These should be IS_ERR() instead of PTR_ERR().  I haven't looked at
the conext outside of this email but it feels like a design mistake
that it's possible for these to be error pointers anyway.

f89823c212246d Lionel Landwerlin     2017-08-03  387  		kfree(oa_config->flex_regs);
f89823c212246d Lionel Landwerlin     2017-08-03  388  	if (!PTR_ERR(oa_config->b_counter_regs))
f89823c212246d Lionel Landwerlin     2017-08-03  389  		kfree(oa_config->b_counter_regs);
f89823c212246d Lionel Landwerlin     2017-08-03  390  	if (!PTR_ERR(oa_config->mux_regs))
f89823c212246d Lionel Landwerlin     2017-08-03  391  		kfree(oa_config->mux_regs);
f89823c212246d Lionel Landwerlin     2017-08-03  392  
6a45008ab7bb5e Lionel Landwerlin     2019-10-12  393  	kfree_rcu(oa_config, rcu);
f89823c212246d Lionel Landwerlin     2017-08-03  394  }

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [drm-drm-intel:drm-intel-next-queued 9/12] drivers/gpu/drm/i915/i915_perf.c:386 i915_oa_config_release() warn: passing zero to 'PTR_ERR'
Date: Sun, 13 Oct 2019 12:23:14 +0300	[thread overview]
Message-ID: <20191013092152.GW13286@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 2929 bytes --]

tree:   git://anongit.freedesktop.org/drm/drm-intel drm-intel-next-queued
head:   5f5c382ecfdd06e17316d1c9f1362522c20cdfef
commit: 6a45008ab7bb5e13b543de0c141b94aaa71d8397 [9/12] drm/i915/perf: allow for CS OA configs to be created lazily

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/gpu/drm/i915/i915_perf.c:386 i915_oa_config_release() warn: passing zero to 'PTR_ERR'

Old smatch warnings:
drivers/gpu/drm/i915/i915_perf.c:388 i915_oa_config_release() warn: passing zero to 'PTR_ERR'
drivers/gpu/drm/i915/i915_perf.c:390 i915_oa_config_release() warn: passing zero to 'PTR_ERR'
drivers/gpu/drm/i915/i915_perf.c:3420 i915_perf_add_config_ioctl() error: double unlock 'mutex:&perf->metrics_lock'
drivers/gpu/drm/i915/i915_perf.c:3427 i915_perf_add_config_ioctl() error: double unlock 'mutex:&perf->metrics_lock'
drivers/gpu/drm/i915/i915_perf.c:3481 i915_perf_remove_config_ioctl() error: double unlock 'mutex:&perf->metrics_lock'
drivers/gpu/drm/i915/i915_perf.c:3490 i915_perf_remove_config_ioctl() error: double unlock 'mutex:&perf->metrics_lock'

git remote add drm-drm-intel git://anongit.freedesktop.org/drm/drm-intel
git remote update drm-drm-intel
git checkout 6a45008ab7bb5e13b543de0c141b94aaa71d8397
vim +/PTR_ERR +386 drivers/gpu/drm/i915/i915_perf.c

6a45008ab7bb5e Lionel Landwerlin     2019-10-12  381  void i915_oa_config_release(struct kref *ref)
f89823c212246d Lionel Landwerlin     2017-08-03  382  {
6a45008ab7bb5e Lionel Landwerlin     2019-10-12  383  	struct i915_oa_config *oa_config =
6a45008ab7bb5e Lionel Landwerlin     2019-10-12  384  		container_of(ref, typeof(*oa_config), ref);
6a45008ab7bb5e Lionel Landwerlin     2019-10-12  385  
f89823c212246d Lionel Landwerlin     2017-08-03 @386  	if (!PTR_ERR(oa_config->flex_regs))

These should be IS_ERR() instead of PTR_ERR().  I haven't looked at
the conext outside of this email but it feels like a design mistake
that it's possible for these to be error pointers anyway.

f89823c212246d Lionel Landwerlin     2017-08-03  387  		kfree(oa_config->flex_regs);
f89823c212246d Lionel Landwerlin     2017-08-03  388  	if (!PTR_ERR(oa_config->b_counter_regs))
f89823c212246d Lionel Landwerlin     2017-08-03  389  		kfree(oa_config->b_counter_regs);
f89823c212246d Lionel Landwerlin     2017-08-03  390  	if (!PTR_ERR(oa_config->mux_regs))
f89823c212246d Lionel Landwerlin     2017-08-03  391  		kfree(oa_config->mux_regs);
f89823c212246d Lionel Landwerlin     2017-08-03  392  
6a45008ab7bb5e Lionel Landwerlin     2019-10-12  393  	kfree_rcu(oa_config, rcu);
f89823c212246d Lionel Landwerlin     2017-08-03  394  }

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

             reply	other threads:[~2019-10-13  9:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-13  9:23 Dan Carpenter [this message]
2019-10-13  9:23 ` [drm-drm-intel:drm-intel-next-queued 9/12] drivers/gpu/drm/i915/i915_perf.c:386 i915_oa_config_release() warn: passing zero to 'PTR_ERR' Dan Carpenter

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=20191013092152.GW13286@kadam \
    --to=dan.carpenter@oracle.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.