All of lore.kernel.org
 help / color / mirror / Atom feed
* [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'
@ 2019-10-13  9:23 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2019-10-13  9:23 UTC (permalink / raw)
  To: kbuild

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [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'
@ 2019-10-13  9:23 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2019-10-13  9:23 UTC (permalink / raw)
  To: kbuild-all

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-13  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2019-10-13  9:23 ` Dan Carpenter

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.