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

2019-09-10 Thread Dan Carpenter
On Sun, Sep 08, 2019 at 06:04:28PM +0200, Sam Ravnborg wrote: > Hi Dan. > > On Wed, Sep 04, 2019 at 09:55:07PM +0300, Dan Carpenter wrote: > > The "lvds->backlight" pointer could be NULL in situations were > > of_parse_phandle() returns NULL. Also it's sl

Re: [PATCH] staging: android: ion: Replace strncpy() for stracpy()

2019-09-10 Thread Dan Carpenter
ame, MAX_HEAP_NAME); > - hdata.name[sizeof(hdata.name) - 1] = '\0'; > + stracpy(hdata.name, heap->name, MAX_HEAP_NAME); stracpy() only takes two arguments. This doesn't compile. regards, dan carpenter

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

2019-09-04 Thread Dan Carpenter
The "lvds->backlight" pointer could be NULL in situations were of_parse_phandle() returns NULL. Also it's slightly cleaner to use backlight_put() which already has a check for NULL built in. Fixes: 7c9dff5bd643 ("drm: panels: Add LVDS panel driver") Signed-off-by

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

2019-09-04 Thread Dan Carpenter
t_device(&lvds->backlight->dev); > + backlight_put(lvds->backlight); Yeah. That's cleaner. I will resend. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

2019-09-04 Thread Dan Carpenter
The "lvds->backlight" pointer could be NULl if of_parse_phandle() returns NULL. Fixes: 7c9dff5bd643 ("drm: panels: Add LVDS panel driver") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/panel/panel-lvds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[bug report] drm/panfrost: Enable devfreq to work without regulator

2019-08-22 Thread Dan Carpenter
ed. 57 pfdev->devfreq.cur_volt); 58 return err; regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/tinydrm: fix a loop in debugfs code

2019-08-21 Thread Dan Carpenter
g works as expected. The upper bound of "count" is capped in __kernel_write() at MAX_RW_COUNT so we don't have to worry about it being higher than INT_MAX. Fixes: 02dd95fe3169 ("drm/tinydrm: Add MIPI DBI support") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/drm_mipi_dbi.c

Re: [PATCH][drm-next] drm/amd/display: fix a potential null pointer dereference

2019-08-16 Thread Dan Carpenter
be NULL. I'm mostly pointing this out because that NULL check is written so higgledy-piggledy. At first I thought this was staging code so I was planning to ignore the patch. :P regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/i915/tgl: Fix TGL_TRANS_DDI_FUNC_CTL_VAL_TO_PORT() macro

2019-08-15 Thread Dan Carpenter
This macro doesn't work because the right shift has higher precedence than bitwise AND. Fixes: 9749a5b6c09f ("drm/i915/tgl: Fix the read of the DDI that transcoder is attached to") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/i915_reg.h | 2 +- 1 file changed, 1

[PATCH] drm/vmwgfx: Fix double free in vmw_recv_msg()

2019-08-15 Thread Dan Carpenter
we can test for that afterward. Fixes: 6b7c3b86f0b6 ("drm/vmwgfx: fix memory leak when too many retries have occurred") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/v

[bug report] drm/komeda: Add writeback support

2019-08-14 Thread Dan Carpenter
kwb_conn->wb_layer->layer_type, 162 &n_formats); regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/i915: Use after free in error path in intel_vgpu_create_workload()

2019-08-08 Thread Dan Carpenter
We can't free "workload" until after the printk or it's a use after free. Fixes: 2089a76ade90 ("drm/i915/gvt: Checking workload's gma earlier") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gvt/scheduler.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] drm/i915: Fix some NULL vs IS_ERR() conditions

2019-08-07 Thread Dan Carpenter
There were several places which check for NULL when they should have been checking for IS_ERR(). Fixes: d8af05ff38ae ("drm/i915: Allow sharing the idle-barrier from other kernel requests") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gt/selftest_context.c | 20 ++---

[bug report] drm/ttm: add transparent huge page support for DMA allocations v2

2019-06-27 Thread Dan Carpenter
kfree(d_page); 320 d_page = NULL; 321 } 322 return d_page; 323 } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] fbtft: Cleanup line over 80 character warnings

2019-06-27 Thread Dan Carpenter
Sorry, I don't feel like this makes it more readable. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[bug report] drm/ttm: TTM fault handler helpers

2019-06-27 Thread Dan Carpenter
eference inside ttm_tt_populate() function. 267 ret = VM_FAULT_OOM; 268 goto out_io_unlock; regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH v2] drm/mcde: Fix uninitialized variable

2019-06-25 Thread Dan Carpenter
On Tue, Jun 25, 2019 at 12:09:54AM +0200, Linus Walleij wrote: > On Tue, Jun 18, 2019 at 2:31 PM Dan Carpenter > wrote: > > > Thanks! > > Recording this as Acked-by: when applying. > That's is an honour for me. I figured that your Signed-off-by dwarfed my Ack

[PATCH] drm: self_refresh: Fix a reversed condition in drm_self_refresh_helper_cleanup()

2019-06-19 Thread Dan Carpenter
This test is flipped around so it either leads to a memory leak or a NULL dereference. Fixes: 1452c25b0e60 ("drm: Add helpers to kick off self refresh mode in drivers") Signed-off-by: Dan Carpenter --- I'm not totally sure what the prefered patch prefix for this code. One thing

Re: [bug report] drm: Add helpers to kick off self refresh mode in drivers

2019-06-19 Thread Dan Carpenter
On Wed, Jun 19, 2019 at 12:39:37PM +0300, Dan Carpenter wrote: > 72 int i, ret; > 73 > 74 drm_modeset_acquire_init(&ctx, 0); > 75 > 76 state = drm_atomic_state_alloc(dev); > 77 if (!state) { > 78

[bug report] drm: Add helpers to kick off self refresh mode in drivers

2019-06-19 Thread Dan Carpenter
ate); ^ NULL dereference. 119 drm_modeset_drop_locks(&ctx); 120 drm_modeset_acquire_fini(&ctx); 121 } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm: return -EFAULT if copy_one_buf() fails

2019-06-18 Thread Dan Carpenter
Ah crap. I need to fix copy_one_buf32() as well. I will sent a v2. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

2019-06-18 Thread Dan Carpenter
The copy_from_user() function returns the number of bytes remaining to be copied but we want to return a negative error code. Otherwise the callers treat it as a successful copy. Signed-off-by: Dan Carpenter --- v2: The first version was missing a chunk drivers/gpu/drm/drm_bufs.c | 5

[PATCH] drm: return -EFAULT if copy_one_buf() fails

2019-06-18 Thread Dan Carpenter
The copy_to_user() function returns the number of bytes remaining to be copied, but we want to return -EFAULT. This function is called from __drm_legacy_infobufs() which expects negative error codes. Fixes: 5c7640ab6258 ("switch compat_drm_infobufs() to drm_ioctl_kernel()") Signed-o

Re: [PATCH v2] drm/mcde: Fix uninitialized variable

2019-06-18 Thread Dan Carpenter
Thanks! regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: use exact allocation for dma coherent memory

2019-06-17 Thread Dan Carpenter
133 if (!sq->queue) 134 return -ENOMEM; 135 sq->phys_addr = virt_to_phys(sq->queue); 136 dma_unmap_addr_set(sq, mapping, sq->dma_addr); 137 return 0; 138 } Is this a bug? regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/mcde: Fix uninitialized variable

2019-06-12 Thread Dan Carpenter
On Wed, Jun 12, 2019 at 03:30:38PM +0200, Linus Walleij wrote: > We need to handle the case when of_drm_find_bridge() returns > NULL. > > Reported-by: Dan Carpenter > Cc: Dan Carpenter > Signed-off-by: Linus Walleij > --- > drivers/gpu/drm/mcde/mcde_drv.c | 4 +

[PATCH] drm/amdgpu: Fix bounds checking in amdgpu_ras_is_supported()

2019-06-08 Thread Dan Carpenter
eal life, because debugfs is generally root only. Fixes: 36ea1bd2d084 ("drm/amdgpu: add debugfs ctrl node") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h b/drivers/gp

Re: [PATCH 1/2] drm/bridge: sii902x: re-order conditions to prevent out of bounds read

2019-06-07 Thread Dan Carpenter
On Fri, Jun 07, 2019 at 09:39:57AM +0200, walter harms wrote: > > > Am 07.06.2019 09:27, schrieb Dan Carpenter: > > This should check that "i" is within bounds before checking reading from > > the array. > > > > Fixes: ff5781634c41 ("d

[PATCH 1/2] drm/bridge: sii902x: re-order conditions to prevent out of bounds read

2019-06-07 Thread Dan Carpenter
This should check that "i" is within bounds before checking reading from the array. Fixes: ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/bridge/sii902x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[PATCH 2/2] drm/bridge: sii902x: fix a signedness bug in sii902x_audio_codec_init()

2019-06-07 Thread Dan Carpenter
The "num_lanes" variable needs to be signed for the error handling to work. The "i" variable can be a regular int as well. Fixes: ff5781634c41 ("drm/bridge: sii902x: Implement HDMI audio support") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/bridge/sii90

[bug report] drm/bridge: sii902x: Implement HDMI audio support

2019-06-07 Thread Dan Carpenter
dev_err(dev, "%s: No clock (audio mclk) found: %ld\n", 755 __func__, PTR_ERR(sii902x->audio.mclk)); 756 return 0; 757 } 758 759 sii902x->audio.pdev = platform_device_register_data( regards, dan ca

Re: [PATCH][next] drm/amd/display: remove redundant assignment to status

2019-06-06 Thread Dan Carpenter
n readers, because people naturally assume it is not dead. GCC has a feature to warn about uninitialized variables and we're randomly initializing status to a bogus value to disable static analysis... regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[bug report] drm/mcde: Add new driver for ST-Ericsson MCDE

2019-05-29 Thread Dan Carpenter
t up the hardware */ 908 mcde_dsi_start(d); ^ d->mdsi is dereferenced without checking for NULL inside here. 909 910 /* Look for a panel as a child to this node */ regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/mcde: Fix an uninitialized variable

2019-05-29 Thread Dan Carpenter
We never set "vblank" to "false". Current versions of GCC will initialize it to zero automatically at certain optimization levels so that's probably why this didn't show up in testing. Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson

[bug report] drm/mcde: Add new driver for ST-Ericsson MCDE

2019-05-29 Thread Dan Carpenter
match); 495 if (ret) { regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[bug report] drm/mcde: Add new driver for ST-Ericsson MCDE

2019-05-29 Thread Dan Carpenter
return PTR_ERR(bridge); ^^^ Should this be -EPROBEDEFER? I'm not sure of the rules. 921 } 922 } 923 } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/i915: selftest_lrc: Check the correct variable

2019-05-29 Thread Dan Carpenter
We should check "request[n]" instead of just "request". Fixes: 78e41ddd2198 ("drm/i915: Apply an execution_mask to the virtual_engine") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gt/selftest_lrc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[bug report] drm/scheduler: rework job destruction

2019-05-22 Thread Dan Carpenter
reference. 298 sched->free_guilty = false; 299 } 300 301 spin_lock_irqsave(&sched->job_list_lock, flags); 302 drm_sched_start_timeout(sched); 303 spin_unlock_irqrestore(&sched->job_list_lock, flags); 304 } r

Re: [PATCH] drm/fb-helper: Fix drm_fb_helper_hotplug_event() NULL ptr argument

2019-05-15 Thread Dan Carpenter
e with DRM userspace") > > introduced a fb_helper dereference before the NULL check. > > Fixup by moving the dereference after the NULL check. > > > > Fixes: 03a9606e7fee ("drm/fb-helper: Avoid race with DRM userspace") > > Reported-by: kbuild test robot > >

[PATCH] drm/amd/powerplay: fix locking in smu_feature_set_supported()

2019-05-15 Thread Dan Carpenter
There is a typo so the code unlocks twice instead of taking the lock and then releasing it. Fixes: f14a323db5b0 ("drm/amd/powerplay: implement update enabled feature state to smc for smu11") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +- 1 file

Re: [PATCH][next] drm/amdgpu: fix return of an uninitialized value in variable ret

2019-05-10 Thread Dan Carpenter
gt; - if (ret) > - return ret; > + return -EINVAL; From a naive reading of the code without knowing the hardware spec then you would probably think that lo_base_addr can also be uninitialized. regards, dan carpenter _

Re: [PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro

2019-05-10 Thread Dan Carpenter
On Fri, May 10, 2019 at 09:13:26AM +, Ardelean, Alexandru wrote: > On Wed, 2019-05-08 at 16:26 +0300, Alexandru Ardelean wrote: > > On Wed, 2019-05-08 at 15:20 +0300, Dan Carpenter wrote: > > > > > > > > > On Wed, May 08, 2019 at 02:28:35PM +0300, Alexa

[drm-intel:drm-intel-next-queued 5/6] drivers/gpu/drm/i915/intel_hdcp.c:1406 hdcp2_authenticate_repeater_topology() warn: should this be a bitwise op?

2019-05-10 Thread Dan Carpenter
robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/i915/intel_hdcp.c:1406 hdcp2_authenticate_repeater_topology() warn: should this be a bitwise op? git remote add drm-intel git://anongit.freedesktop.org/drm-intel git remote update drm-intel git checkout

[drm-intel:drm-intel-next-queued 4/6] drivers/gpu/drm/drm_hdcp.c:190 drm_hdcp_parse_hdcp2_srm() warn: mask and shift to zero

2019-05-10 Thread Dan Carpenter
Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/drm_hdcp.c:190 drm_hdcp_parse_hdcp2_srm() warn: mask and shift to zero git remote add drm-intel git://anongit.freedesktop.org/drm-intel git remote update drm-intel git checkout 6498bf5800a302ef69e7f4914e727893f278bb2f vim +190 drivers/gpu

Re: [PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro

2019-05-08 Thread Dan Carpenter
, > NR_PHY_TYPES There is no need for NR_PHY_TYPES now so you could remove that as well. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[bug report] drm/panfrost: Add sanity checks to submit IOCTL

2019-05-07 Thread Dan Carpenter
j_replace_fence(sync_out, job->render_done_fence); 218 219 fail_job: 220 panfrost_job_put(job); 221 fail_out_sync: 222 drm_syncobj_put(sync_out); ^^^^ Otherwise we are toasted... 223 224 return ret; 225 } regards, dan ca

[PATCH] drm/komeda: Potential error pointer dereference

2019-05-03 Thread Dan Carpenter
We need to check whether drm_atomic_get_crtc_state() returns an error pointer before dereferencing "crtc_st". Fixes: 7d31b9e7a550 ("drm/komeda: Add komeda_plane/plane_helper_funcs") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 2 +

Re: [PATCH] staging: ion: solve warning symbol was not declared

2019-04-24 Thread Dan Carpenter
te(phys_addr_t base, size_t size) > +static inline struct ion_heap *ion_carveout_heap_create(phys_addr_t base, > size_t size) Why are you making it inline? Btw, normally we just leave it for the compiler to choose which functions to make inline. regards, dan carpenter _

[drm:drm-legacy-cleanup 17/24] drivers/gpu/drm/drm_lock.c:359 drm_legacy_lock_master_cleanup() warn: curly braces intended?

2019-04-24 Thread Dan Carpenter
Reported-by: kbuild test robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/drm_lock.c:359 drm_legacy_lock_master_cleanup() warn: curly braces intended? git remote add drm git://people.freedesktop.org/~airlied/linux.git git remote update drm git checkout

Re: [PATCH 3/4] lib/hexdump.c: Replace ascii bool in hex_dump_to_buffer with flags

2019-04-09 Thread Dan Carpenter
ize, int groupsize, > if (j) > lx--; > } > - if (!ascii) > + if (!flags & HEXDUMP_ASCII) ^^ This is a precedence bug. It should be if (!(flags & HEXDUMP_ASCII)). > goto nil; > regards, dan

Re: [PATCH] staging: android: ion: refactory ion_alloc for kernel driver use

2019-03-29 Thread Dan Carpenter
If we're going to export ion_alloc() for other drivers to use then let's make an ion_free() helper function as well. void ion_free(struct dma_buf *dmabuf) { dma_buf_put(dmabuf); } regards, dan carpenter ___ dri-devel mailing list

Re: [PATCH v2 1/5] drm: Add helpers to kick off self refresh mode in drivers

2019-03-28 Thread Dan Carpenter
Hi Sean, url: https://github.com/0day-ci/linux/commits/Sean-Paul/drm-Add-helpers-to-kick-off-self-refresh-mode-in-drivers/20190327-194853 smatch warnings: drivers/gpu/drm/drm_self_refresh_helper.c:105 drm_self_refresh_helper_entry_work() error: uninitialized symbol 'ret'. # https://github.

[PATCH] drm/mediatek: Fix an error code in mtk_hdmi_dt_parse_pdata()

2019-03-28 Thread Dan Carpenter
We don't want to overwrite "ret", it already holds the correct error code. The "regmap" variable might be a valid pointer as this point. Fixes: 8f83f26891e1 ("drm/mediatek: Add HDMI support") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/mediatek/mtk_hdmi.

Re: [PATCH] drm/i915/selftests: Fix an IS_ERR() vs NULL check

2019-03-26 Thread Dan Carpenter
On Tue, Mar 26, 2019 at 02:53:49PM +, Chris Wilson wrote: > Quoting Mika Kuoppala (2019-03-26 09:30:57) > > Dan Carpenter writes: > > > > > The live_context() function returns error pointers. It never returns > > > NULL. > > > > > > Fixes:

[radeon-alex:drm-next-5.2-wip 230/300] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:514 dce_aux_transfer_with_retries() error: uninitialized symbol 'operation_result'.

2019-03-26 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-5.2-wip head: 940d104240cd069a88f089f91299ac9bf4a154d1 commit: 2bec3b50c9c5be65ac4800d57ace6fc3b2d82136 [230/300] drm/amd/display: Respect aux return values smatch warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:514

[radeon-alex:amd-staging-drm-next 377/447] drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1007 amdgpu_ras_add_bad_pages() warn: variable dereferenced before check 'con' (see line 1003)

2019-03-26 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next head: c9115f8904eef0f880d3b4f8306f553b1bb1c532 commit: ef3da5cab664c16ca25a8d479fac95a7f04080e3 [377/447] drm/amdgpu: add amdgpu_ras.c to support ras smatch warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1007 amdgpu_r

[PATCH] drm/i915/selftests: Fix an IS_ERR() vs NULL check

2019-03-25 Thread Dan Carpenter
The live_context() function returns error pointers. It never returns NULL. Fixes: 9c1477e83e62 ("drm/i915/selftests: Exercise adding requests to a full GGTT") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH] drm/i915: Fix an error code in i915_gem_context_open()

2019-03-25 Thread Dan Carpenter
If gem_context_register() fails then "ctx" is a valid pointer, not an error pointer. We should just return "err". Fixes: 3aa9945a528e ("drm/i915: Separate GEM context construction and registration to userspace") Signed-off-by: Dan Carpenter --- drivers/gpu/d

[PATCH] drm: shmem: Off by one in drm_gem_shmem_fault()

2019-03-21 Thread Dan Carpenter
The shmem->pages[] array has "num_pages" elements so the > should be >= to prevent reading beyond the end of the array. The shmem->pages[] array is allocated in drm_gem_shmem_prime_import_sg_table(). Fixes: 2194a63a818d ("drm: Add library for shmem backed GEM o

[PATCH] drm/v3d: fix a NULL vs error pointer mixup

2019-03-20 Thread Dan Carpenter
The drm_gem_shmem_create() returns error pointers and v3d_bo_create() is also supposed to return error pointers. Fixes: 40609d4820b2 ("drm/v3d: Use the new shmem helpers to reduce driver boilerplate.") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/v3d/v3d_bo.c | 4 ++-- 1 file

Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems

2019-03-11 Thread Dan Carpenter
I feel like you need to break the patch up a bit and do the white space fixes separate from the other changes. (Probably you're going to have to redo this several times because it's hard to review when it's so mixed up with multiple changes at the same time). regards

Re: [PATCH] FBTFT: fbtft-bus: Fix code style problems

2019-03-11 Thread Dan Carpenter
7;s not really clear what you're trying to do actually... You need to sell your patch a bit to try convince us that it's worth applying. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freede

Re: [RFC v4 08/17] kunit: test: add support for test abort

2019-02-28 Thread Dan Carpenter
mix them, it means that NULL is a special kind of success. Like we try to load a feature and we get back: valid pointer <-- success null <-- feature is disabled. not an error. error pointer <-- feature is broken. fail. regards, dan carpenter ___

[PATCH] drm/nouveau/dmem: Fix a NULL vs IS_ERR() check

2019-02-21 Thread Dan Carpenter
The hmm_devmem_add() function doesn't return NULL, it returns error pointers. Fixes: 5be73b690875 ("drm/nouveau/dmem: device memory helpers for SVM") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[bug report] drm/amd/display: Call into DC once per multiplane flip

2019-02-19 Thread Dan Carpenter
dc_state); 4851 mutex_unlock(&dm->dc_lock); 4852 } 4853 4854 if (planes_count) { regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [Intel-gfx] [PATCH 1/3] drm/i915: Move dsc rate params compute into drm

2019-02-14 Thread Dan Carpenter via dri-devel
Hi David, url: https://github.com/0day-ci/linux/commits/David-Francis/Make-DRM-DSC-helpers-more-generally-usable/20190214-052541 smatch warnings: drivers/gpu/drm/drm_dsc.c:306 drm_dsc_compute_rc_parameters() warn: impossible condition '(vdsc_cfg->nfl_bpg_offset > 65535) => (0-u16max > u16max

[PATCH] drm/msm: fix an error code in the ioctl

2019-02-13 Thread Dan Carpenter via dri-devel
The copy_to/from_user() functions return the number of bytes remaining to be copied but we should return -EFAULT to the user. Fixes: f05c83e77460 ("drm/msm: add uapi to get/set debug name") Signed-off-by: Dan Carpenter --- If I were reviewing this patch, I would be suspicous that we do

[radeon-alex:drm-next-5.1-wip 212/267] drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1096 amdgpu_cs_process_fence_dep() error: 'fence' dereferencing possible ERR_PTR()

2019-02-07 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-5.1-wip head: c05834c8acc8278f87203cf4ec2a513be3a6aa7d commit: 67dd1a36334ffce82bebeb2d633e152aa436d370 [212/267] drm/amdgpu: Add AMDGPU_CHUNK_ID_SCHEDULED_DEPENDENCIES smatch warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:1096 am

[PATCH] drm/etnaviv: potential NULL dereference

2019-02-05 Thread Dan Carpenter
The etnaviv_gem_prime_get_sg_table() is supposed to return error pointers. Otherwise it can lead to a NULL dereference when it's called from drm_gem_map_dma_buf(). Fixes: 5f4a4a73f437 ("drm/etnaviv: fix gem_prime_get_sg_table to return new SG table") Signed-off-by: Dan Carpente

Re: [PATCH] staging: android: ion: fix sys heap pool's gfp_flags

2019-02-01 Thread Dan Carpenter
r > alloc") Huh... Presumably you found this bug just by reading the code. I wonder how it affects runtime? regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

2019-01-29 Thread Dan Carpenter
gt;name, sizeof(domain->name)); 418 419 domain->iter++; 420 if (domain->iter == meta->nr_domains) 421 domain->iter = 0xff; 422 423 return 0; 424 } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/komeda: Off by one in komeda_fb_get_pixel_addr()

2019-01-23 Thread Dan Carpenter
The > should be >= to avoid an off by one bug. Fixes: c46c24bb6b11 ("drm/komeda: Add komeda_framebuffer") Signed-off-by: Dan Carpenter --- I'm 98% sure this is correct, but please review it carefully because I'm not 100% positive. drivers/gpu/drm/arm/display/komed

[PATCH] drm/komeda: Fix a signedness bug

2019-01-21 Thread Dan Carpenter
The mdev->irq value comes from platform_get_irq() so it can't be more than INT_MAX and if it's unsigned then it breaks the error handling in komeda_parse_dt(). Fixes: 29e56aec911d ("drm/komeda: Add DT parsing") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/arm/display/

[PATCH] drm/etnaviv: NULL vs IS_ERR() buf in etnaviv_core_dump()

2019-01-14 Thread Dan Carpenter
The etnaviv_gem_get_pages() never returns NULL. It returns error pointers on error. Fixes: a8c21a5451d8 ("drm/etnaviv: add initial etnaviv DRM driver") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/etnaviv/etnaviv_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

dri-devel@lists.freedesktop.org

2019-01-14 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.21-wip head: 364c6471cc8cca8dbaa558077597c525b3d7f9e6 commit: 2c5acb77e1ad3dfa5658f6c8b769e264b53728b4 [79/110] drm/amdgpu: Add sysfs file for PCIe usage v5 New smatch warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:2138 amdgpu_p

Re: [PATCH] drm/etnaviv: fix some off by one bugs

2018-12-21 Thread Dan Carpenter
I don't think anyone responded to this one? regards, dan carpenter On Fri, Jul 13, 2018 at 06:00:18PM +0300, Dan Carpenter wrote: > The ->nr_signal is the supposed to be the number of elements in the > ->signal array. There was one place where it was 5 but it was supposed >

Re: [PATCH v2 -next] staging: fbtft: use strcmp() instead of strncmp() for

2018-12-18 Thread Dan Carpenter
> Signed-off-by: YueHaibing > --- > v2: fix patch title v2 is worse than v1... v1 is a little long but I wouldn't have complained about it. Please assume that the subject and the commit message are separate things. Take a look how the patch description reads on marc.info: h

[PATCH] drm: Fix an error pointer dereference()

2018-12-17 Thread Dan Carpenter
The drm_mode_create_tile_group() is only called from drm_parse_tiled_block() and the caller expects it to return a NULL on error. In other words, this function should match drm_mode_get_tile_group(). Signed-off-by: Dan Carpenter --- I sent a version of this patch last year which updated

[PATCH] drm/ati_pcigart: Fix error code in drm_ati_pcigart_init()

2018-12-16 Thread Dan Carpenter
failure. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/ati_pcigart.c | 7 --- drivers/gpu/drm/r128/r128_cce.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c index 6c4d4b6eba80..2362f07fe1fc 100644 --- a

[radeon-alex:drm-next-4.21 64/142] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:4942 amdgpu_dm_atomic_commit_tail() error: we previously assumed 'dc_state' could be null (see line 4927)

2018-12-10 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.21 head: 22666cc1481ae3814d9c7718418cc4a3aa7d90c3 commit: eb3dc8978596a045f469f13bb13271a707623ecb [64/142] drm/amd/display: Use private obj helpers for dm_atomic_state New smatch warnings: drivers/gpu/drm/amd/amdgpu/../display/am

Re: [PATCH 04/26] Staging: fbtft: flexfb: Switch to the gpio descriptor interface

2018-11-26 Thread Dan Carpenter
e checks as well in the same patch. Otherwise it breaks `git bisect`. (I don't know this code well. But it just feels like it has to be breaking git bisect just from from glancing at the patches. Perhaps I have misunderstood). regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[radeon-alex:drm-next-4.21-wip 113/125] drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_abm.c:86 calculate_16_bit_backlight_from_pwm() warn: should 'bl_pwm << (1 + bl_int_count)' be a 64 bit type?

2018-10-31 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.21-wip head: 6830ffcb15a5bae3f031734b75b11a5f489a52bf commit: 6459eb8ee95150ffbdfcd0c9325945be80f98cf8 [113/125] drm/amd/display: Expand dc to use 16.16 bit backlight smatch warnings: drivers/gpu/drm/amd/amdgpu/../display/dc/dce/d

Re: [PATCH 2/2] fbdev: sbuslib: integer overflow in sbusfb_ioctl_helper()

2018-10-17 Thread Dan Carpenter
On Mon, Oct 08, 2018 at 12:49:07PM +0200, Bartlomiej Zolnierkiewicz wrote: > > On 08/31/2018 10:09 AM, Dan Carpenter wrote: > > The "index + count" addition can overflow. Both come directly from the > > user. This bug leads to an information leak. > >

[bug report] drm/sun4i: Add HDMI support

2018-10-17 Thread Dan Carpenter
} 58 } 59 60 if (div && half) { 61 *div = best_m; 62 *half = is_double; ^^ This is either true or uninitialized. 63 } 64 65

[radeon-alex:drm-next-4.21-wip 10/27] drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1174 vcn_v1_0_stop_dpg_mode() error: uninitialized symbol 'ret_code'.

2018-10-16 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.21-wip head: 6af94a9d0e185f48bef5cc1372f3ada89d003858 commit: 15296db70619984157e60666da5da8994a66870e [10/27] drm/amdgpu/vcn:Add ring W/R PTR check for VCN DPG mode stop smatch warnings: drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c:1174

[PATCH] drm/msm/gpu: Fix a couple memory leaks in debugfs

2018-10-13 Thread Dan Carpenter
The msm_gpu_open() function should free "show_priv" on error or it causes static checker warnings. Fixes: 4f776f4511c7 ("drm/msm/gpu: Convert the GPU show function to use the GPU state") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/msm_debugfs.c | 15 +++

[PATCH] drm/exynos: checking for NULL instead of IS_ERR()

2018-10-13 Thread Dan Carpenter
The of_drm_find_panel() function returns error pointers and never NULL but we the driver assumes that ->panel is NULL when it's not present. Fixes: 6afb7721e2a0 ("drm/exynos: move connector creation to attach callback") Signed-off-by: Dan Carpenter diff --git a/driv

[bug report] drm/vmwgfx: Use new validation interface for the modesetting code v2

2018-10-11 Thread Dan Carpenter
() which presumably does the right thing. But the warning is correct that "handle" can be uninitialized here. 2607 if (out_fence) 2608 *out_fence = fence; 2609 else 2610 vmw_fence_obj_unreference(&f

Re: [bug report] drm/sun4i: Handle DRM_BUS_FLAG_PIXDATA_*EDGE checking if panel is used.

2018-10-11 Thread Dan Carpenter
On Tue, Oct 02, 2018 at 03:26:22PM +0200, Giulio Benetti wrote: > Il 01/10/2018 11:36, Dan Carpenter ha scritto: > > Hello Giulio Benetti, > > > > The patch 490cda5a3c82: "drm/sun4i: Handle DRM_BUS_FLAG_PIXDATA_*EDGE > > checking if panel is used." from

Re: [PATCH][drm-next] drm/vmwgfx: remove redundant return ret statement

2018-10-11 Thread Dan Carpenter
ected by CoverityScan, CID#1473793 ("Structurally dead code") > Introduced by commit b139d43dacef ("drm/vmwgfx: Make buffer object lookups reference-free during validation"). The fix looks good. regards, dan carpenter ___ dri-devel

[PATCH] udlfb: fix some inconsistent NULL checking

2018-10-10 Thread Dan Carpenter
t can't be NULL so let's remove that check. Signed-off-by: Dan Carpenter diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index 070026a7e55a..1d034dddc556 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1598,7 +1598,7 @@ static

[PATCH] drm/omap: Use after free in omap_connector_destroy()

2018-10-01 Thread Dan Carpenter
We can free "omap_connector" until the end of the function. Fixes: 949ea2ef3fed ("drm/omap: Don't call HPD registration operations recursively") Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_conne

Re: [bug report] drm/msm: Add SDM845 DPU support

2018-10-01 Thread Dan Carpenter
On Mon, Oct 01, 2018 at 12:38:56PM +0300, Dan Carpenter wrote: > Hello Jeykumar Sankaran, > > The patch 25fdd5933e4c: "drm/msm: Add SDM845 DPU support" from Jun > 27, 2018, leads to the following static checker warning: > > drivers/gpu/drm/msm/msm_drv.c:562

[bug report] drm/msm: Add SDM845 DPU support

2018-10-01 Thread Dan Carpenter
kthread_init_worker(&priv->event_thread[i].worker); 570 priv->event_thread[i].dev = ddev; 571 priv->event_thread[i].thread = 572 kthread_run(kthread_worker_fn, 573 &a

[bug report] drm/sun4i: Handle DRM_BUS_FLAG_PIXDATA_*EDGE checking if panel is used.

2018-10-01 Thread Dan Carpenter
^^ Unpossible to be an error pointer! 559 struct drm_panel *panel = tcon->panel; 560 struct drm_connector *connector = panel->connector; 561 struct drm_display_info displ

Re: [PATCH resend 00/15] staging: vboxvideo: Convert to atomic modesetting API

2018-10-01 Thread Dan Carpenter
Why are you resending this? It's because you added some more patches on the end? Just send those as a new series... regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinf

[PATCH] drm/amdgpu: fix a NULL check in debugfs init

2018-09-26 Thread Dan Carpenter
The debugfs_create_file() returns error pointers if DEBUGFS isn't enabled. But here, we know that it is enabled so it returns NULL on error which could lead to a NULL dereference a few lines later. Signed-off-by: Dan Carpenter --- If someone wanted to delete the error handling as well

Re: [PATCH 1/6] drm/dp_mst: Introduce drm_dp_mst_connector_atomic_check()

2018-09-20 Thread Dan Carpenter
Hi Lyude, Thank you for the patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Lyude-Paul/Fix-legacy-DPMS-changes-with-MST/20180919-203434 base: git://anongit.freedesktop.org/drm-intel for-linux-next smatch warnings: drivers/gpu/drm/drm_dp_mst_topology.c:314

[radeon-alex:amd-staging-drm-next-pco 299/339] drivers/gpu/drm/amd/amdgpu/gfxhub_v1_1.c:49 gfxhub_v1_1_get_xgmi_info() warn: should '(((amdgpu_mm_rreg(adev, (adev->reg_offset[1][0][0] + 2424), 0)) & 6

2018-09-14 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next-pco head: bbab57a341c90ed6e32de8edf4e89dc5c55cddac commit: 5c777a51926dd6bbbf82dc5bddd980a408f0f618 [299/339] drm/amdgpu/gmc9: Adjust GART and AGP location with xgmi offset smatch warnings: drivers/gpu/drm/amd/amdgpu/gfx

[PATCH] udmabuf: fix error code in map_udmabuf()

2018-09-14 Thread Dan Carpenter
We accidentally forgot to set "ret" on this error path so it means we return NULL instead of an error pointer. The caller checks for NULL and changes it to an error pointer so it doesn't cause an issue at run time. Signed-off-by: Dan Carpenter diff --git a/drivers/dma-buf/udma

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