Re: KASAN: use-after-free Read in drm_gem_object_release

2020-07-10 Thread Dan Carpenter
t's where it was allocated. This code is quite subtle so I'm not going to attempt to fix it because I can't test it. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/vmwgfx: Fix two list_for_each loop exit tests

2020-06-26 Thread Dan Carpenter
not equal to unit at the end of the loop. In the second loop we exit when mode is not pointing to a valid drm_display_mode struct so it doesn't make sense to check "mode->type". Fixes: a278724aa23c ("drm/vmwgfx: Implement fbdev on kms v2") Signed-off-by: Dan Carpenter

[PATCH] drm/vmwgfx: Use correct vmw_legacy_display_unit pointer

2020-06-26 Thread Dan Carpenter
x: Support older hardware.") Signed-off-by: Dan Carpenter --- >From static analysis. Not tested. This bug celebrated its tenth birthday last month. :) drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vm

[PATCH] drm/vc4: call ->post_disable() functions in vc4_dsi_encoder_disable()

2020-06-26 Thread Dan Carpenter
ing") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vc4/vc4_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c index eaf276978ee7..f92d0e92fa72 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/

Re: [bug report] drm/vc4: dsi: Fix bridge chain handling

2020-06-24 Thread Dan Carpenter
On Wed, Jun 24, 2020 at 08:30:25PM +0200, Boris Brezillon wrote: > Hello Dan, > > On Wed, 24 Jun 2020 20:58:06 +0300 > Dan Carpenter wrote: > > > Hello Boris Brezillon, > > > > The patch 033bfe7538a1: "drm/vc4: dsi: Fix bridge chain handling" &g

[bug report] drm/vc4: dsi: Fix bridge chain handling

2020-06-24 Thread Dan Carpenter
_disable_unprepare(dsi->pll_phy_clock); 763 clk_disable_unprepare(dsi->escape_clock); 764 clk_disable_unprepare(dsi->pixel_clock); 765 766 pm_runtime_put(dev); 767 } regards, dan carpenter ___ dr

[kbuild] Re: [PATCH v7 33/36] rapidio: fix common struct sg_table related issues

2020-06-23 Thread Dan Carpenter
you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/rapidio/devices/rio_mport_cdev.c:939 rio_dma_transfer() error: uninitialized symbol 'nents'. # https://github.com/0day-ci/li

[PATCH] drm/virtio: Fix an IS_ERR() vs NULL check in virtio_gpu_object_shmem_init()

2020-06-19 Thread Dan Carpenter
The drm_gem_shmem_get_pages_sgt() function returns error pointers on error, it never returns NULL. Fixes: d323bb44e4d2 ("drm/virtio: Call the right shmem helpers") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/virtio/virtgpu_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH] drm/arm: fix unintentional integer overflow on left shift

2020-06-18 Thread Dan Carpenter
Yeah. There is a checkpatch warning for it and everything. :) But I like the way you think. Start with patches to staging though. People don't necessarily like doing cleanups on ancient code. regards, dan carpenter ___ dri-devel mailing list dri-

Re: [PATCH][next] drm/mm/selftests: fix unsigned comparison with less than zero

2020-06-18 Thread Dan Carpenter
then there would be no ambiguity. 1051 } 1052 } 1053 1054 /* introduce fragmentation by freeing every other node */ 1055 for (i = 0; i < num_insert; i++) { 1056 if (i % 2 == 0) 1057

Re: [PATCH] drm/i915/display: fix missing null check on allocated dsb object

2020-06-16 Thread Dan Carpenter
Note: added a drm_err message in keeping with the error message style > in the function. Don't give in to peer pressure! That's like being a lemming when Disney film makers come to push you off the cliff to create the 1958 nature film "Whi

[PATCH] drm/vc4: Fix an error code vc4_create_object()

2020-06-15 Thread Dan Carpenter
cache.") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vc4/vc4_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 72d30d90b856c..0af246a5609ca 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/g

Re: [PATCH] drm/amd/display: Fix indenting in dcn30_set_output_transfer_func()

2020-06-08 Thread Dan Carpenter
On Mon, Jun 08, 2020 at 10:16:27AM -0700, Joe Perches wrote: > On Mon, 2020-06-08 at 17:16 +0300, Dan Carpenter wrote: > > These lines are a part of the if statement and they are supposed to > > be indented one more tab. > > > > Signed-off-by: Dan Carpenter >

[PATCH] drm/amd/display: Fix indenting in dcn30_set_output_transfer_func()

2020-06-08 Thread Dan Carpenter
These lines are a part of the if statement and they are supposed to be indented one more tab. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn30

Re: [PATCH v8 4/8] PM / EM: add support for other devices than CPUs in Energy Model

2020-06-08 Thread Dan Carpenter
It's not really a proper bug report so it doesn't deserve a reported-by. Thanks, though! regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v8 4/8] PM / EM: add support for other devices than CPUs in Energy Model

2020-06-08 Thread Dan Carpenter
On Mon, Jun 08, 2020 at 01:34:37PM +0100, Lukasz Luba wrote: > Hi Dan, > > Thank you for your analyzes. > > On 6/8/20 12:51 PM, Dan Carpenter wrote: > > Hi Lukasz, > > > > I love your patch! Perhaps something to improve: > > > > url: > > h

Re: [PATCH v8 4/8] PM / EM: add support for other devices than CPUs in Energy Model

2020-06-08 Thread Dan Carpenter
-m021-20200605 (attached as .config) compiler: gcc-9 (Debian 9.3.0-13) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: kernel/power/energy_model.c:316 em_dev_register_perf_domain() error: we previously

Re: [PATCH v3 09/13] device core: Introduce multiple dma pfn offsets

2020-06-04 Thread Dan Carpenter
return -ENOMEM; r->uniform_offset = true; r->pfn_offset = pfn_offset; return 0; The code allocates "r" and then doesn't save it anywhere so there is no point. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v3 09/13] device core: Introduce multiple dma pfn offsets

2020-06-04 Thread Dan Carpenter
dma_pfn_offset_region *r; > + > + if (!dev) > + return -ENODEV; > + > + if (!pfn_offset) > + return 0; > + > + r = devm_kcalloc(dev, 1, sizeof(struct dma_pfn_offset_region), > + GFP_KERNEL); Use:r = devm_kzalloc(dev, sizeof(*r), GFP_KERNEL); > + if (!r) > + return -ENOMEM; > + > + r->uniform_offset = true; > + r->pfn_offset = pfn_offset; > + > + return 0; > +} This function doesn't seem to do anything useful. Is part of it missing? > +EXPORT_SYMBOL_GPL(attach_uniform_dma_pfn_offset); > + regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-06-02 Thread Dan Carpenter
cessful return from this function? Heh. You're right. The patch is freeing "clk" on the success path so that doesn't work. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: Re: [PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()

2020-06-02 Thread Dan Carpenter
The original patch was basically fine. Just add a Fixes tag and resend. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v6] drm/ioctl: Add a ioctl to set and get a label on GEM objects

2020-06-02 Thread Dan Carpenter
.config) compiler: gcc-9 (Debian 9.3.0-13) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot Reported-by: Dan Carpenter New smatch warnings: drivers/gpu/drm/drm_gem.c:1004 drm_gem_get_label() warn: maybe return -EFAULT instead of the bytes remaining

[PATCH v3] drm/amdgpu: off by one in amdgpu_device_attr_create_groups() error handling

2020-05-20 Thread Dan Carpenter
847c38f7 ("drm/amdgpu: optimize amdgpu device attribute code") Signed-off-by: Dan Carpenter --- v2: style change v3: Fix embarrassing typo in the subject drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/d

[PATCH v2] drm/amdgpu: off by on in amdgpu_device_attr_create_groups() error handling

2020-05-20 Thread Dan Carpenter
847c38f7 ("drm/amdgpu: optimize amdgpu device attribute code") Signed-off-by: Dan Carpenter --- v2: style change drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/

Re: [PATCH] drm/amdgpu: off by on in amdgpu_device_attr_create_groups() error handling

2020-05-20 Thread Dan Carpenter
On Wed, May 20, 2020 at 02:05:19PM +0200, Christian König wrote: > Am 20.05.20 um 14:00 schrieb Dan Carpenter: > > This loop in the error handling code should start a "i - 1" and end at > > "i == 0". Currently it starts a "i" and ends at "i == 1&

[PATCH] drm/amdgpu: off by on in amdgpu_device_attr_create_groups() error handling

2020-05-20 Thread Dan Carpenter
847c38f7 ("drm/amdgpu: optimize amdgpu device attribute code") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index

[PATCH] drm/etnaviv: Fix a leak in submit_pin_objects()

2020-05-18 Thread Dan Carpenter
If the mapping address is wrong then we have to release the reference to it before returning -EINVAL. Fixes: 00ddc0b2 ("drm/etnaviv: implement softpin") Signed-off-by: Dan Carpenter --- >From static analysis. Untested. drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 4 +++- 1

Re: [PATCH] video: fbdev: pxa3xx_gcu: Fix some resource leak in an error handling path in 'pxa3xx_gcu_probe()'

2020-04-29 Thread Dan Carpenter
located is confusing but harmless. The clk_disable_unprepare() is done on some paths where the clock was not enabled and that will trigger a WARN() so that's a bug. Syzcaller will complain and if you have reboot on WARN then it's annoying. The second bug is that we don't dereg

Re: [PATCH v1] staging: fbtft: fb_st7789v: Initialize the Display

2020-04-28 Thread Dan Carpenter
On Mon, Apr 27, 2020 at 02:36:25PM +0200, Oliver Graute wrote: > On 27/04/20, Dan Carpenter wrote: > > On Mon, Apr 27, 2020 at 10:36:42AM +0200, Oliver Graute wrote: > > > On 09/04/20, Dan Carpenter wrote: > > > > On Thu, Apr 09, 2020 at 11:25:32AM +0200, Olive

Re: [PATCH v1] staging: fbtft: fb_st7789v: enabled inversion

2020-04-28 Thread Dan Carpenter
On Mon, Apr 27, 2020 at 10:29:39AM +0200, Oliver Graute wrote: > On 09/04/20, Dan Carpenter wrote: > > On Thu, Apr 09, 2020 at 11:24:05AM +0200, Oliver Graute wrote: > > > From: Oliver Graute > > > > > > Enable inversion mode > > > > What the hec

Re: [PATCH v1] staging: fbtft: fb_st7789v: Initialize the Display

2020-04-27 Thread Dan Carpenter
On Mon, Apr 27, 2020 at 10:36:42AM +0200, Oliver Graute wrote: > On 09/04/20, Dan Carpenter wrote: > > On Thu, Apr 09, 2020 at 11:25:32AM +0200, Oliver Graute wrote: > > > From: Oliver Graute > > > > > > Set Gamma Values and Register Values for the HSD20_IP

Re: [bug report] drm/xen-front: Add support for Xen PV display frontend

2020-04-21 Thread Dan Carpenter
On Tue, Apr 21, 2020 at 08:59:09PM +0200, Julia Lawall wrote: > > > On Tue, 21 Apr 2020, Dan Carpenter wrote: > > > On Tue, Apr 21, 2020 at 05:29:02PM +0200, Julia Lawall wrote: > > > > > > > > > On Tue, 21 Apr 2020, Dan Carpenter wrote: > > &g

Re: [bug report] drm/xen-front: Add support for Xen PV display frontend

2020-04-21 Thread Dan Carpenter
On Tue, Apr 21, 2020 at 05:29:02PM +0200, Julia Lawall wrote: > > > On Tue, 21 Apr 2020, Dan Carpenter wrote: > > > Hi Kernel Janitors, > > > > Here is another idea that someone could work on, fixing the > > IS_ERR_OR_NULL() checks in the xen driver. >

Re: [bug report] drm/xen-front: Add support for Xen PV display frontend

2020-04-21 Thread Dan Carpenter
g, because if the pointer was really NULL then it's not handled correctly and would eventually lead to a runtime failure. Normally Smatch is smart enough to know that the pointer isn't NULL so it doesn't generate a warning but yesterday I introduced a bug in Smatch by mistake. I

[bug report] drm/xen-front: Add support for Xen PV display frontend

2020-04-21 Thread Dan Carpenter
r error pointers but that's because of a bug in the unreleased version of Smatch and because gem_create() uses IS_ERR_OR_NULL(). 141 142 return &xen_obj->base; 143 } regards, dan carpenter ___ dri-deve

Re: [PATCH] staging: android: ion: Skip sync if not mapped

2020-04-16 Thread Dan Carpenter
Great! Thanks! regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] staging: android: ion: Skip sync if not mapped

2020-04-16 Thread Dan Carpenter
continue; > dma_sync_sg_for_cpu(a->dev, a->table->sgl, a->table->nents, > direction); > } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/i915/gt: remove redundant assignment to variable x

2020-04-16 Thread Dan Carpenter
mit while I think it should emphasize that it's a pre-merge > report on the patch on the mailing list. > To be honest, these are auto-generated by the kbuild bot and I was a bit confused myself. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/i915/gt: remove redundant assignment to variable x

2020-04-14 Thread Dan Carpenter
Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/i915/gt/intel_engine_cs.c:1210 print_request() error: uninitialized symbol 'x'. # https://github.com/0day-ci/linux/commit/6ee08d455bba0066e8f5f276dcd43d9e3e594dc5 git remote add linux-review https://github.com/0day-ci

Re: [PATCH v1] staging: fbtft: fb_st7789v: Initialize the Display

2020-04-09 Thread Dan Carpenter
be: if (new_hardware) write_reg(par, PORCTRL, 0x05, 0x05, 0x00, 0x33, 0x33); else write_reg(par, PORCTRL, 0x08, 0x08, 0x00, 0x22, 0x22); Same comment for the rest of the patch. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v1] staging: fbtft: fb_st7789v: enabled inversion

2020-04-09 Thread Dan Carpenter
On Thu, Apr 09, 2020 at 11:24:05AM +0200, Oliver Graute wrote: > From: Oliver Graute > > Enable inversion mode What the heck is an inversion mode and why would you want it? regards, dasn carpenter ___ dri-devel mailing list dri-devel@lists.freedeskto

Re: [PATCH v1] staging: fbtft: fb_st7789v: enabled inversion

2020-04-09 Thread Dan Carpenter
PWCTRL1, 0xA4, 0xA1); > > write_reg(par, MIPI_DCS_SET_DISPLAY_ON); > + > + /* enable inversion mode */ > + write_reg(par, 0x21); Use the define and delete the comment. write_reg(par, MIPI_DCS_ENTER_INVERT_MODE); regards, dan carpenter _

Re: [PATCH] drm/gem: Fix a leak in drm_gem_objects_lookup()

2020-03-23 Thread Dan Carpenter
On Mon, Mar 23, 2020 at 11:13:22AM +, Emil Velikov wrote: > Hi Dan, > > On Fri, 20 Mar 2020 at 13:23, Dan Carpenter wrote: > > > > If the "handles" allocation or the copy_from_user() fails then we leak > > "objs". It's supposed

Re: [PATCH v10 00/12] Convert PWM period and duty cycle to u64

2020-03-21 Thread Dan Carpenter
This is a giant CC list. There was one version where you CC'd me on patch 6/12 but after that you just CC'd me on the cover page. Something is messed up in your scripts because Cc'ing me on just the cover is pointless. regards, dan carpenter

[PATCH net-next] drm/amdgpu: Uninitialized variable in gfx_v9_0_rlcg_wreg()

2020-03-20 Thread Dan Carpenter
t;drm/amdgpu: revise RLCG access path") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 7bc2486167e7..affbff76758c 100

[PATCH] drm/gem: Fix a leak in drm_gem_objects_lookup()

2020-03-20 Thread Dan Carpenter
If the "handles" allocation or the copy_from_user() fails then we leak "objs". It's supposed to be freed in panfrost_job_cleanup(). Fixes: c117aa4d8701 ("drm: Add a drm_gem_objects_lookup helper") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/drm_gem.c | 4

Re: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'

2020-03-12 Thread Dan Carpenter
am) { > + dc_stream_release(new_stream); > + new_stream = NULL; > + } > > > dc_stream_release() is NULL-checked, so the if can be dropped. > > re, > wh Walter, it's really hard to separate your reply from the quoted ema

Re: [PATCH 03/51] drm: add managed resources tied to drm_device

2020-03-03 Thread Dan Carpenter
: kbuild test robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/drm_drv.c:843 drm_dev_release() error: dereferencing freed memory 'dev' # https://github.com/0day-ci/linux/commit/5aba700d4c32ae5722a9931c959b13a6217a86e2 git remote add linux-review https://github.com/0day-ci

[PATCH] drm: prevent a harmless integer overflow in drm_legacy_sg_alloc()

2020-02-28 Thread Dan Carpenter
There is an integer overflow when we round up to PAGE_SIZE, but it's harmless because we never re-use "request->size" for anything meaningful. Signed-off-by: Dan Carpenter --- This code predates git. drivers/gpu/drm/drm_scatter.c | 3 +++ 1 file changed, 3 insertions(+) di

Re: [PATCH v7 0/2] Add initial support for slimport anx7625

2020-02-24 Thread Dan Carpenter
ou fixed in v4 last November. What changed in this version? My guess is that nothing changed and you are just prodding us to re-review it... Feel free to say that also because we can't read your mind. regards, dan carpenter ___ dri-devel mailing li

[PATCH] drm/amdgpu/display: clean up some indenting

2020-02-24 Thread Dan Carpenter
These lines were accidentally indented 4 spaces more than they should be. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers

[PATCH] drm/amdgpu: return -EFAULT if copy_to_user() fails

2020-02-12 Thread Dan Carpenter
The copy_to_user() function returns the number of bytes remaining to be copied, but we want to return a negative error code to the user. Fixes: 030d5b97a54b ("drm/amdgpu: use amdgpu_device_vram_access in amdgpu_ttm_vram_read") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/

[bug report] drm: revocation check at drm subsystem

2020-02-11 Thread Dan Carpenter
(((byte) & 0xC) >> 6) 0xC >> 6 is always zero. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [bug report] drm/ttm: fix re-init of global structures

2020-02-04 Thread Dan Carpenter
On Tue, Feb 04, 2020 at 03:03:43PM +0100, Christian König wrote: > Am 04.02.20 um 13:57 schrieb Dan Carpenter: > > Hello Christian König, > > > > The patch bd4264112f93: "drm/ttm: fix re-init of global structures" > > from Apr 16, 2019, leads to

[bug report] drm/ttm: fix re-init of global structures

2020-02-04 Thread Dan Carpenter
elease() a few seconds after this memset. Maybe put the memset into ttm_bo_global_kobj_release()? 1611 out: 1612 mutex_unlock(&ttm_global_mutex); 1613 } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedeskto

Re: KASAN: use-after-free Read in vgem_gem_dumb_create

2020-02-03 Thread Dan Carpenter
66 ("drm/amdgpu: use kernel is_power_of_2 rather than > > local version") > > Aside: This bisect line is complete nonsense ... I'm kinda at the > point where I'm assuming that syzbot bisect results are garbage, which > is maybe not what we want. I guess muc

Re: KASAN: use-after-free Read in vgem_gem_dumb_create

2020-02-01 Thread Dan Carpenter
On Sat, Feb 01, 2020 at 05:02:47PM +0800, Hillf Danton wrote: > > On Sat, 1 Feb 2020 09:17:57 +0300 Dan Carpenter wrote: > > On Sat, Feb 01, 2020 at 12:32:09PM +0800, Hillf Danton wrote: > > > > > > Release obj in error path. > > > > > > --- a/dri

Re: KASAN: use-after-free Read in vgem_gem_dumb_create

2020-01-31 Thread Dan Carpenter
;88809fa67900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > > ^ > > 88809fa67980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > > 88809fa67a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > > ====

Re: KASAN: use-after-free Read in vgem_gem_dumb_create

2020-01-31 Thread Dan Carpenter
R_PTR(ret); 202 203 return &obj->base; 204 } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/amd/display: Possible divide by zero in set_speed()

2020-01-30 Thread Dan Carpenter
If "speed" is zero then we use it as a divisor to find "prescale". It's better to move the check for zero to the very start of the function. Fixes: 9eeec26a1339 ("drm/amd/display: Refine i2c frequency calculating sequence") Signed-off-by: Dan Carpenter ---

Re: [PATCH] dma-buf: fix locking in sync_print_obj()

2020-01-24 Thread Dan Carpenter
On Fri, Jan 24, 2020 at 10:20:56AM +, Chris Wilson wrote: > Quoting Dan Carpenter (2020-01-24 10:13:12) > > This is always called with IRQs disabled and we don't actually want to > > enable IRQs at the end. > > > > Fixes: a6aa8fca4d79 ("dma-buf/sw-sync:

[PATCH] dma-buf: fix locking in sync_print_obj()

2020-01-24 Thread Dan Carpenter
This is always called with IRQs disabled and we don't actually want to enable IRQs at the end. Fixes: a6aa8fca4d79 ("dma-buf/sw-sync: Reduce irqsave/irqrestore from known context") Signed-off-by: Dan Carpenter --- drivers/dma-buf/sync_debug.c | 5 +++-- 1 file changed, 3 i

Re: [PATCH AUTOSEL 5.4 002/205] drm/panfrost: Add missing check for pfdev->regulator

2020-01-18 Thread Dan Carpenter
ain for > stable maintainers, I dred every time I see a drm patch tagged for > stable. > > But we've been over this all before :( Another example is: 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl") 0d352a3a8a1f (&

[PATCH v2] fbdev: potential information leak in do_fb_ioctl()

2020-01-13 Thread Dan Carpenter
call copy_from/to_user() with mutex held") Signed-off-by: Dan Carpenter --- v2: Use memcpy() drivers/video/fbdev/core/fbmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index d04554959ea7..bb8d8dbc0461

[PATCH] drm/v3d: Fix a double free in the ioctl

2020-01-09 Thread Dan Carpenter
This code used to leak "bin" but then we accidentally merged two fixes so now it's a double free. Fixes: 77e0723bd27f ("Merge v5.4-rc7 into drm-next") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/v3d/v3d_gem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/driv

Re: [PATCH -next] drm/mgag200: Fix typo in parameter description

2020-01-09 Thread Dan Carpenter
s actually the description for "hw_bug_no_startadd". > Fixes: 3cacb2086e41 ("drm/mgag200: Add module parameter to pin all buffers at > offset 0") > Signed-off-by: Wei Yongjun regards, dan carpenter ___ dri-d

[PATCH] nouveau/secboot/gm20b: initialize pointer in gm20b_secboot_new()

2020-01-07 Thread Dan Carpenter
We accidentally set "psb" which is a no-op instead of "*psb" so it generates a static checker warning. We should probably set it before the first error return so that it's always initialized. Fixes: 923f1bd27bf1 ("drm/nouveau/secboot/gm20b: add secure boot support&

[PATCH] gpu/drm: clean up white space in drm_legacy_lock_master_cleanup()

2020-01-07 Thread Dan Carpenter
We moved this code to a different file and accidentally deleted a newline. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/drm_lock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index 2e8ce99d0baa..2c79e8199e3c

[drm-intel:drm-intel-next-queued 20/20] drivers/gpu/drm/i915/gt/intel_lrc.c:4613 intel_execlists_create_virtual() warn: assigning (-2) to unsigned variable 've->base.uabi_instance'

2020-01-06 Thread Dan Carpenter
test robot Reported-by: Dan Carpenter New smatch warnings: drivers/gpu/drm/i915/gt/intel_lrc.c:4613 intel_execlists_create_virtual() warn: assigning (-2) to unsigned variable 've->base.uabi_instance' Old smatch warnings: drivers/gpu/drm/i915/gt/intel_lrc.c:4612 intel_execlists_c

[PATCH] drm/i915/bios: fix off by one in parse_generic_dtd()

2019-12-12 Thread Dan Carpenter
The "num_dtd" variable is the number of elements in the generic_dtd->dtd[] array so the > needs to be >= to prevent reading one element beyond the end of the array. Fixes: 33ef6d4fd8df ("drm/i915/vbt: Handle generic DTD block") Signed-off-by: Dan Carpenter ---

[PATCH] drm/i915: unmap the correct pointer in i915_error_object_create()

2019-11-26 Thread Dan Carpenter
We should be unmapping "page" instead of "s". This code originally used kmap_atomic() before it was changed to kmap(). The two mapping functions are different which leads to this common mistake. Fixes: 3e749f5199e1 ("drm/i915: Avoid atomic context for error cap

[PATCH] drm/amdgpu: Fix a bug in jpeg_v1_0_start()

2019-11-26 Thread Dan Carpenter
Originally the last WREG32_SOC15() was a part of the if statement block but the curly braces are on the wrong line. Fixes: bb0db70f3f75 ("drm/amdgpu: separate JPEG1.0 code out from VCN1.0") Signed-off-by: Dan Carpenter --- From static analysis (Smatch). Not tested. drivers/gpu/drm/

Re: [bug report] dma-buf: heaps: Add heap helpers

2019-11-02 Thread Dan Carpenter
On Fri, Nov 01, 2019 at 12:31:53PM -0700, John Stultz wrote: > On Thu, Oct 31, 2019 at 4:07 AM Dan Carpenter > wrote: > > The patch 7b87ea704fd9: "dma-buf: heaps: Add heap helpers" from Oct > > 21, 2019, leads to the following static checker warning: > > >

[bug report] dma-buf: heaps: Add heap helpers

2019-10-31 Thread Dan Carpenter
return 0; 169 } 170 171 static const struct vm_operations_struct dma_heap_vm_ops = { 172 .fault = dma_heap_vm_fault, 173 }; 174 regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https:

[PATCH] dma-buf: Fix a warning message in dma_heap_buffer_destroy()

2019-10-29 Thread Dan Carpenter
The first argument of WARN() is a condition so this will just print the function name instead of the whole warning message. Fixes: 7b87ea704fd9 ("dma-buf: heaps: Add heap helpers") Signed-off-by: Dan Carpenter --- drivers/dma-buf/heaps/heap-helpers.c | 2 +- 1 file changed, 1 inser

[PATCH] fbdev: potential information leak in do_fb_ioctl()

2019-10-29 Thread Dan Carpenter
The "fix" struct has a 2 byte hole after ->ywrapstep and the "fix = info->fix;" assignment doesn't necessarily clear it. It depends on the compiler. Fixes: 1f5e31d7e55a ("fbmem: don't call copy_from/to_user() with mutex held") Signed-off-by: Dan C

Re: [PATCH] drm/sched: Fix passing zero to 'PTR_ERR' warning

2019-10-29 Thread Dan Carpenter
fence = sched->ops->run_job(s_job); /* FIXME: Oct 2019: Remove this code when fence can't be NULL. */ if (!fence) fence = ERR_PTR(-EINVAL); if (IS_ERR(fence)) { ... regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/sched: Fix passing zero to 'PTR_ERR' warning

2019-10-29 Thread Dan Carpenter
: - if (IS_ERR(fence)) - return PTR_ERR(fence); - return 0; + return PTR_ERR_OR_ZERO(fence); regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [bug report] drm/sched: Set error to s_fence if HW job submission failed.

2019-10-29 Thread Dan Carpenter
I sent that too quickly. See also: drivers/gpu/drm/scheduler/sched_main.c:750 drm_sched_main() warn: passing zero to 'PTR_ERR' which is a few lines later. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop

[bug report] drm/sched: Set error to s_fence if HW job submission failed.

2019-10-29 Thread Dan Carpenter
^^ If "fence" is NULL then it triggers a WARN_ON() inside the dma_fence_set_error() function. WARN_ON(error >= 0 || error < -MAX_ERRNO); ^^ 501 } else { 502 s_job-&g

Re: [PATCH][next] drm/v3d: fix double free of bin

2019-10-25 Thread Dan Carpenter
ux-next. I sent this fix to you and Stephen Rothwell yesterday so this one is sorted already. Stephen will apply my patch until you guys merge your drm trees. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/v3d: Fix double free in v3d_submit_cl_ioctl()

2019-10-24 Thread Dan Carpenter
Originally this error path used to leak "bin" but then we accidentally applied two separate commits to fix it and ended up with a double free. Signed-off-by: Dan Carpenter --- Hi Stephen, I think this one is actually just a linux-next issue and the Fixes tag would point to commit f8

[PATCH] drm/amdgpu/vi: silence an uninitialized variable warning

2019-10-17 Thread Dan Carpenter
ialized symbol 'baco_reset'. Fixes: 425db2553e43 ("drm/amdgpu: expose BACO interfaces to upper level from PP") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/powerplay/amd

[drm-intel:drm-intel-next-queued 1/1] drivers/gpu/drm/i915/i915_irq.c:2283 icp_irq_handler() error: uninitialized symbol 'tc_port_hotplug_long_detect'.

2019-10-15 Thread Dan Carpenter
g tag Reported-by: kbuild test robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/i915/i915_irq.c:2283 icp_irq_handler() error: uninitialized symbol 'tc_port_hotplug_long_detect'. git remote add drm-intel git://anongit.freedesktop.org/drm-intel git remote update drm-int

Re: [PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver

2019-10-15 Thread Dan Carpenter
tag Reported-by: kbuild test robot Reported-by: Dan Carpenter New smatch warnings: drivers/gpu/drm/bridge/analogix/anx7625.c:1274 anx7625_start_dp_work() error: uninitialized symbol 'sp_tx_lane_count'. # https://github.com/0day-ci/linux/commit/152a82b6747f10d6c13c7a422173947c2f

Re: [PATCH v4] drm/ioctl: Add a ioctl to label GEM objects

2019-10-12 Thread Dan Carpenter
Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/drm_gem.c:967 drm_dumb_set_label_ioctl() error: 'label' dereferencing possible ERR_PTR() # https://github.com/0day-ci/linux/commit/0f0cd7ef9f3b1623ab982f12dc748998f31e10b4 git remote add linux-review https://github.com/0day

Re: [PATCH v2 0/2] Add initial support for slimport anx7625

2019-10-11 Thread Dan Carpenter
any mistakes, please let me know, I will fix it > in > the next series. > > Thanks, > Xin > I'm not a domain expert but I like these patches now. Reviewed-by: Dan Carpenter regards, dan carpenter

Re: [PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver

2019-10-10 Thread Dan Carpenter
On Thu, Oct 10, 2019 at 12:53:15PM +0300, Dan Carpenter wrote: > This code is *so* much nicer than before. I hope you feel good about > the changes. It makes me happy to look at this code now. > > On Thu, Oct 10, 2019 at 09:34:19AM +, Xin Ji wrote: > > +static in

Re: [PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver

2019-10-10 Thread Dan Carpenter
AP_AUX_BUFF_START, > + MAX_DPCD_BUFFER_SIZE, buf); > + if (!ret) > + break; > + } > + } > + > + if (cnt == EDID_TRY_CNT) > + return -EIO; > + > + return 0; > +} regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver

2019-10-09 Thread Dan Carpenter
On Wed, Oct 09, 2019 at 02:30:32PM +0300, Dan Carpenter wrote: > > + platform = kzalloc(sizeof(*platform), GFP_KERNEL); > > + if (!platform) { > > + DRM_DEV_ERROR(dev, "failed to allocate driver data\n"); > > + ret = -ENOMEM; > > +

Re: [PATCH v2 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver

2019-10-09 Thread Dan Carpenter
Are you sure you sent the correct patch? This has many of the same style issues I mentioned in the previous email. The error handling in edid_read() is wrong. probe() will still crash if allocating the work queue fails. On Wed, Oct 09, 2019 at 09:28:02AM +, Xin Ji wrote: > The ANX7625 is an

Re: [PATCH][next] drm/komeda: remove redundant assignment to pointer disable_done

2019-10-07 Thread Dan Carpenter
ation. The other thing is that soon get_maintainer.pl will start CC'ing people from the Fixes tag and right now Lowry Li is not CC'd so that's unfortunate. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/amd/powerplay: unlock on error in smu_resume()

2019-10-07 Thread Dan Carpenter
This function needs to drop the mutex before returning. Fixes: f7e3a5776fa6 ("drm/amd/powerplay: check SMU engine readiness before proceeding on S3 resume") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH] drm/amd/powerplay: Fix error handling in smu_init_fb_allocations()

2019-10-07 Thread Dan Carpenter
d make "i" signed int for the error handling to work, so I just updated "ret" as well as a clean up. Fixes: f96357a991b9 ("drm/amd/powerplay: implement smu_init(fini)_fb_allocations function") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 +

[PATCH] drm/amdkfd: Fix a && vs || typo

2019-10-07 Thread Dan Carpenter
In the current code if "device_info" is ever NULL then the kernel will Oops so probably || was intended instead of &&. Fixes: e392c887df97 ("drm/amdkfd: Use array to probe kfd2kgd_calls") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdkfd/kfd_device

[PATCH] drm/i810: Prevent underflow in ioctl

2019-10-04 Thread Dan Carpenter
The "used" variables here come from the user in the ioctl and it can be negative. It could result in an out of bounds write. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i810/i810_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i810/

Re: [PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc

2019-10-01 Thread Dan Carpenter
address this issue. > > Fixes: c296d5f9957c ("staging: fbtft: core support") > Signed-off-by: Navid Emamdoost Looks good. Reviewed-by: Dan Carpenter regards, dan carpenter

[bug report] drm/etnaviv: add infrastructure to query perf counter

2019-09-25 Thread Dan Carpenter
;iter == meta->nr_domains) 443 domain->iter = 0xff; 444 445 return 0; 446 } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v1 2/2] drm/bridge: anx7625: Add anx7625 MIPI to DP bridge driver

2019-09-23 Thread Dan Carpenter
I wish you would think more about the error codes that you're returning. Most functions do "ret |= frob()." which ORs the error codes together, and results in a nonsense negative error code. But then some functions return 1 on error and zero on success which is sometimes a bug, sometimes confusing

[PATCH v3] drm: panel-lvds: Potential Oops in probe error handling

2019-09-11 Thread Dan Carpenter
The "lvds->backlight" pointer could be NULL in situations where of_parse_phandle() returns NULL. This code is cleaner if we use the managed devm_of_find_backlight() so the clean up is automatic. Fixes: 7c9dff5bd643 ("drm: panels: Add LVDS panel driver") Signed-off-by: Dan

<    2   3   4   5   6   7   8   9   10   11   >