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
ife, 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/gpu/drm

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 dele

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

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

2019-06-06 Thread Dan Carpenter
ders, 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
e 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 MCDE"

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

2019-05-29 Thread Dan Carpenter
ponent match\n"); 490 ret = PTR_ERR(match); 491 goto clk_disable; 492 } 493 ret = component_master_add_with_match(>dev, _drm_comp_ops, 494match); 495 if

[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
sched->free_guilty = false; 299 } 300 301 spin_lock_irqsave(>job_list_lock, flags); 302 drm_sched_start_timeout(sched); 303 spin_unlock_irqrestore(>job_list_lock, flags); 304 } regards, dan carpenter

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
_PHY, > 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
c_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 carpenter ___

[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-10 Thread Dan Carpenter
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 carp

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 dri-devel

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'. #

[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.c | 1

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:

[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

[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-22 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-21 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, dan carpenter

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

2019-03-11 Thread Dan Carpenter
ot 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.freedesktop.org/mailm

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
4851 mutex_unlock(>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 >

[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

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

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
->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/komeda/komeda_f

[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/komeda/kom

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

[radeon-alex:drm-next-4.21-wip 79/110] drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:2138 amdgpu_pm_sysfs_init() warn: maybe use && instead of

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

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 > to be

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

2018-12-18 Thread Dan Carpenter
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: https://marc.info/?l=linux-drive

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

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

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

2018-11-26 Thread Dan Carpenter
ecks 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:

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 r

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

[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/drivers/g

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

2018-10-11 Thread Dan Carpenter
ight 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(); 2611 } re

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 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 int dlfb_usb_pr

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

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
(>event_thread[i].worker); 570 priv->event_thread[i].dev = ddev; 571 priv->event_thread[i].thread = 572 kthread_run(kthread_worker_fn, 573 >event_thread[i].worker, 574

[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 display_info = connector

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/listinfo/dri

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

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

[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/udmabuf.c

Re: [PATCH 4.19 regression fix 1/2] staging: vboxvideo: Fix IRQs no longer working

2018-09-11 Thread Dan Carpenter
someone then uses and unsigned type the error case would return as > success while the < 0 would be detected at compile time (or other static > code checkers). If the function returns int but ret is an unsigned int and we do "if (ret)", then ye

Re: [PATCH 4.19 regression fix 1/2] staging: vboxvideo: Fix IRQs no longer working

2018-09-11 Thread Dan Carpenter
ed variable warning. Just to spell it out a little more, the error code won't be printed for "if (ret)" because negatives are a subset of non-zero. Of course, if you do it consistently there won't be a warning message. I never see the consistent subsystems, so I don't know if they exist. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

2018-08-31 Thread Dan Carpenter
The "index + count" addition can overflow. Both come directly from the user. This bug leads to an information leak. Signed-off-by: Dan Carpenter --- Btw, commit 250c6c49e3b6 ("fbdev: Fixing arbitrary kernel leak in case FBIOGETCMAP_SPARC in sbusfb_ioctl_helper().") doesn'

[PATCH 1/2] fbdev: sbuslib: use checked version of put_user()

2018-08-31 Thread Dan Carpenter
I'm not sure why the code assumes that only the first put_user() needs an access_ok() check. I have made all the put_user() and get_user() calls checked. Signed-off-by: Dan Carpenter diff --git a/drivers/video/fbdev/sbuslib.c b/drivers/video/fbdev/sbuslib.c index a436d44f1b7f..90c51330969c

Re: [PATCH v1 5/5] tinydrm: add winstar wg160160 driver

2018-08-06 Thread Dan Carpenter
Hi Sam, I love your patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Sam-Ravnborg/dt-bindings-add-parallel-data-bus-pardata/20180803-090135 smatch warnings: drivers/gpu/drm/tinydrm/wg160160.c:145 write_buf() warn: right shifting more than type allows 8 vs

[bug report] drm/amd/display: Read AUX channel even if only status byte is returned

2018-07-31 Thread Dan Carpenter
76 ); 677 678 break; 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.19-wip 101/128] drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/vega12_hwmgr.c:504 vega12_get_dpm_frequency_by_index() error: uninitialized symbol 'result'.

2018-07-19 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.19-wip head: 73b1f7132d9ad442b24d70d8769a4642302d6b49 commit: ce7577a2194b58bf7faf303612a24b7cd5210afc [101/128] drm/amdgpu/pp: split out common smumgr smu9 code smatch warnings:

Re: [PATCH v3] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-07-19 Thread Dan Carpenter
Reviewed-by: Dan Carpenter regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()

2018-07-19 Thread Dan Carpenter
Oleksandr sent this patch already. Please disregard mine. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()

2018-07-19 Thread Dan Carpenter
these earlier. After a while these things all look the same. I once accidentally wrote and sent the same patch three times without realizing. Yeah. Please resend a v3. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.

[PATCH] drm/cma-helper: NULL dereference calling drm_gem_cma_prime_get_sg_table()

2018-07-19 Thread Dan Carpenter
This funciton is only called from drm_gem_map_dma_buf(). It's supposed to return error pointers on failure and returning a NULL pointer will lead to a NULL dereference. Fixes: 78467dc5f70f ("drm/cma: add low-level hook functions to use prime helpers") Signed-off-by: Dan Carpenter

[PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()

2018-07-19 Thread Dan Carpenter
The xen_drm_front_gem_get_sg_table() function is supposed to return error pointer. The current code, would trigger a NULL dereference in drm_gem_map_dma_buf(). Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend") Signed-off-by: Dan Carpenter diff --git a/d

[bug report] drm: re-enable error handling

2018-07-19 Thread Dan Carpenter
can't be true. 376 DRM_DEBUG("Not enough free contexts.\n"); 377 /* Should this return -EBUSY instead? */ 378 return -ENOMEM; 379 } regards, dan carpenter ___ d

[PATCH] drm/vkms: off by one in vkms_gem_fault()

2018-07-14 Thread Dan Carpenter
The > should be >= so that we don't read one page beyond the end of the obj->pages[] array. Fixes: 559e50fd34d1 ("drm/vkms: Add dumb operations") Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/vkms/vkms_gem.c b/drivers/gpu/drm/vkms/vkms_gem.c index c7e38368602b..

[PATCH] fbdev: omapfb: off by one in omapfb_register_client()

2018-07-13 Thread Dan Carpenter
The omapfb_register_client[] array has OMAPFB_PLANE_NUM elements so the > should be >= or we are one element beyond the end of the array. Fixes: 8b08cf2b64f5 ("OMAP: add TI OMAP framebuffer driver") Signed-off-by: Dan Carpenter diff --git a/drivers/video/fbdev/omap/omapfb_m

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

2018-07-13 Thread Dan Carpenter
rastructure to query perf counter") Signed-off-by: Dan Carpenter --- Not tested. diff --git a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c b/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c index 9980d81a26e3..4227a4006c34 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_perfmon.c +++ b/drivers

[PATCH] fbdev: omapfb: off by one in omapfb_register_client()

2018-07-13 Thread Dan Carpenter
The omapfb_register_client[] array has OMAPFB_PLANE_NUM elements so the > should be >= or we are one element beyond the end of the array. Fixes: 8b08cf2b64f5 ("OMAP: add TI OMAP framebuffer driver") Signed-off-by: Dan Carpenter diff --git a/drivers/video/fbdev/omap/omapfb_m

Re: [PATCH v2] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-07-12 Thread Dan Carpenter
On Thu, Jul 12, 2018 at 02:58:00PM +0300, Oleksandr Andrushchenko wrote: > On 06/18/2018 03:32 PM, Oleksandr Andrushchenko wrote: > > On 06/18/2018 03:29 PM, Dan Carpenter wrote: > > > On Mon, Jun 18, 2018 at 09:07:09AM +0300, Oleksandr Andrushchenko wrote: >

[bug report] drm: Begin an API for in-kernel clients

2018-07-11 Thread Dan Carpenter
^^ Freed here 288 err_free: 289 kfree(buffer); ^^ Double free 290 291 return ERR_PTR(ret); 292 } 293 regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.fr

[PATCH] drm/nouveau/hwmon: potential uninitialized variables

2018-07-11 Thread Dan Carpenter
Smatch complains that "value" can be uninitialized when kstrtol() returns -ERANGE. Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c index 44178b4c3599..08a1ab6b150d 100644 --- a/drivers/gpu/drm/nouveau/nouve

[PATCH] drm/savage: off by one in savage_bci_cmdbuf()

2018-07-04 Thread Dan Carpenter
The > should be >= here so that we don't read beyond the end of the dma->buflist[] array. Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/savage/savage_state.c b/drivers/gpu/drm/savage/savage_state.c index 2db89bed52e8..7559a820bd43 100644 --- a/drivers/gpu/drm/savage/savag

[PATCH] drm/amd/display: off by one in find_irq_source_info()

2018-07-04 Thread Dan Carpenter
The ->info[] array has DAL_IRQ_SOURCES_NUMBER elements so this condition should be >= instead of > or we could read one element beyond the end of the array. Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Dan Carpenter diff --git a/drivers/gpu

[PATCH] drm/virtio: fix bounds check in virtio_gpu_cmd_get_capset()

2018-07-04 Thread Dan Carpenter
ement beyond the end of the vgdev->capsets[] array. Fixes: 62fb7a5e1096 ("virtio-gpu: add 3d/virgl support") Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 020070d483d3..4735bd1c7321 100644 --- a/drivers/gpu/drm/vi

[PATCH] drm/panel: type promotion bug in s6e8aa0_read_mtp_id()

2018-07-04 Thread Dan Carpenter
The ARRAY_SIZE() macro is type size_t. If s6e8aa0_dcs_read() returns a negative error code, then "ret < ARRAY_SIZE(id)" is false because the negative error code is type promoted to a high positive value. Fixes: 02051ca06371 ("drm/panel: add S6E8AA0 driver") Signed-off-b

[PATCH] drm/i810: off by one in i810_dma_vertex()

2018-07-03 Thread Dan Carpenter
If vertex->idx == dma->buf_count then we end up reading one element beyond the end of the dma->buflist[] array. Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c index 576a417690d4..3b378936f575 100644 --- a/drivers/gpu

  1   2   3   4   5   6   7   8   >