[PATCH] drm/vgem: off by one in vgem_gem_fault()

2018-07-03 Thread Dan Carpenter
If page_offset is == num_pages then we end up reading beyond the end of obj->pages[]. Fixes: af33a9190d02 ("drm/vgem: Enable dmabuf import interfaces") Signed-off-by: Dan Carpenter --- Static analysis. Not tested diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vg

[PATCH] video: fbdev: metronomefb: fix some off by one bugs

2018-07-03 Thread Dan Carpenter
The "mem" buffer has "size" bytes. The ">" should be ">=" to prevent reading one character beyond the end of the array. Signed-off-by: Dan Carpenter --- Not tested. diff --git a/drivers/video/fbdev/metronomefb.c b/drivers/video/fbdev/metrono

Re: [PATCH v2 5/9] drm/nouveau: Use drm_connector_for_each_possible_encoder()

2018-06-30 Thread Dan Carpenter
Hi Ville, Thank you for the patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Ville-Syrjala/drm-Third-attempt-at-fixing-the-fb-helper-best_encoder-mess/20180629-014202 base: git://people.freedesktop.org/~airlied/linux.git drm-next smatch warnings:

Re: [Intel-gfx] [PATCH v5 08/40] drm/i915: Initialize HDCP2.2 and its MEI interface

2018-06-28 Thread Dan Carpenter
[ The bot has a bug where it doesn't copy the error messages so I just guess what the issue is. - dan ] Hi Ramalingam, Thank you for the patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Ramalingam-C/drm-i915-Implement-HDCP2-2/20180627-174219 base:

Re: [PATCH] staging: android: ion: fix ion_dma_buf_attach signatur

2018-06-20 Thread Dan Carpenter
lied this? Can't you just resend the original? > I missed this driver, sorry for the noise. Patch is not even compile > tested. > Please put that sort of information under the --- cut off because it doesn't really belong in the final git log. > Signed-off-by: Christian Köni

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

2018-06-18 Thread Dan Carpenter
If dma_get_sgtable() fails then we return NULL. Fix that and it should be good. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [bug report] drm/prime: replace NULL with error value in drm_prime_pages_to_sg

2018-06-15 Thread Dan Carpenter
the replacement IS_ERR was one of items. > > > > IMHO it is still better to modify those two functions, > > drm_gem_cma_prime_get_sg_table and xen_drm_front_gem_get_sg_table. > > > > Thank you. > > Best regards YJ > > > > > > On Thu, 14 J

[bug report] drm/prime: replace NULL with error value in drm_prime_pages_to_sg

2018-06-14 Thread Dan Carpenter
prime_attach->sgt = sgt; 324 prime_attach->dir = dir; 325 } 326 } 327 328 return sgt; regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH][V2] drm/i915/guc: fix GEM_BUG_ON check

2018-06-12 Thread Dan Carpenter
t; @@ -206,7 +206,7 @@ void intel_guc_fini(struct intel_guc *guc) > static u32 get_log_control_flags(void) > { > u32 level = i915_modparams.guc_log_level; > - u32 flags = 0; > + s32 flags = 0; > > GEM_BUG_ON(level < 0); Only insane people use &quo

[PATCH] drm/i2c: tda998x: remove an unecessary check

2018-06-02 Thread Dan Carpenter
cec_read() returns a u8 so "val" can't be negative. If there is an error in cec_read() then it returns zero. Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 6ebd8842dbcc..86e3aee44686 100644 --- a/drivers/g

[bug report] drm/sun4i: backend: Check for the number of alpha planes

2018-05-31 Thread Dan Carpenter
plane->index); 492 493 layer_state->uses_frontend = true; 494 num_frontend_planes++; 495 } else { 496 layer_state->uses_frontend = false; 497 } regards, dan carpenter ___

[PATCH] drm/nouveau/core: ERR_PTR vs NULL bug in nvkm_engine_info()

2018-05-30 Thread Dan Carpenter
The nvkm_engine_ref() function returns error pointers, not NULL on error. I fixed that but I also had to reverse some of the checks so it didn't become too convoluted. Fixes: c5c9127b25b2 ("drm/nouveau/device: implement a generic method to query device-specific properties") Signed-o

[PATCH] drm/v3d: Checking for NULL vs IS_ERR()

2018-05-18 Thread Dan Carpenter
The v3d_fence_create() only returns error pointers on error. It never returns NULL. Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/dri

[PATCH] drm/exynos: fimc: signedness bug in fimc_setup_clocks()

2018-05-18 Thread Dan Carpenter
"id" needs to be signed for the error handling to work. Fixes: 7a2d5c77c558 ("drm/exynos: fimc: Convert driver to IPP v2 core API") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exyn

[bug report] drm/amd/pp: Change voltage/clk range for OD feature on VI

2018-05-17 Thread Dan Carpenter
x_vddc'. drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c:1588 vegam_populate_clock_stretcher_data_table() error: uninitialized symbol 'efuse'. drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c:1725 vegam_populate_avfs_parameters() erro

[bug report] drm/exynos: Add driver for Exynos Scaler module

2018-05-17 Thread Dan Carpenter
ning '(-22)' drivers/gpu/drm/exynos/exynos_drm_scaler.c 399 400 static inline bool scaler_task_done(u32 val) 401 { 402 return val & SCALER_INT_STATUS_FRAME_END ? 0 : -EINVAL; ^^^ 403 } 404 regards,

Re: [PATCH v2] drm/dumb-buffers: Integer overflow in drm_mode_create_ioctl()

2018-05-16 Thread Dan Carpenter
Btw, I've looked at this some more and I'm 99% sure there is no way to exploit it. The "if (PAGE_ALIGN(size) == 0)" prevents the integer overflow in __vgem_gem_create() that I was worried about. regards, dan carpenter ___ dri-devel mailin

Re: [PATCH v2] drm/dumb-buffers: Integer overflow in drm_mode_create_ioctl()

2018-05-16 Thread Dan Carpenter
On Wed, May 16, 2018 at 03:56:55PM +0100, Chris Wilson wrote: > Quoting Dan Carpenter (2018-05-16 15:52:57) > > On Wed, May 16, 2018 at 03:26:07PM +0100, Chris Wilson wrote: > > > Quoting Dan Carpenter (2018-05-16 15:00:26) > > > > There is a comment here which says

Re: [PATCH v2] drm/dumb-buffers: Integer overflow in drm_mode_create_ioctl()

2018-05-16 Thread Dan Carpenter
On Wed, May 16, 2018 at 03:26:07PM +0100, Chris Wilson wrote: > Quoting Dan Carpenter (2018-05-16 15:00:26) > > There is a comment here which says that DIV_ROUND_UP() and that's where > > the problem comes from. Say you pick: > > > > args->bpp = UINT_MAX -

[PATCH v2] drm/dumb-buffers: Integer overflow in drm_mode_create_ioctl()

2018-05-16 Thread Dan Carpenter
how we picked args->width that means cpp < UINT_MAX / 4. I've fixed it by preventing the integer overflow in DIV_ROUND_UP(). I removed the check for !cpp because it's not possible after this change. I also changed all the 0xU references to U32_MAX. Signed-off-by: Dan Carpenter

Re: [PATCH v2] drm/dumb-buffers: Integer overflow in drm_mode_create_ioctl()

2018-05-09 Thread Dan Carpenter
On Wed, May 09, 2018 at 09:18:57AM +0100, Chris Wilson wrote: > Quoting Dan Carpenter (2018-05-09 09:12:54) > > There is a comment here which says that DIV_ROUND_UP() can overflow and > > that's where the problem comes from. Say you pick: > > > >

[PATCH v2] drm/dumb-buffers: Integer overflow in drm_mode_create_ioctl()

2018-05-09 Thread Dan Carpenter
and because of how we picked args->width that means cpp < UINT_MAX / 4. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- v2: correct a typo in the commit message diff --git a/drivers/gpu/drm/drm_dumb_buffers.c b/drivers/gpu/drm/drm_dumb_buffers.c index 39ac15ce4702..45b0b5

[PATCH] drm/dumb-buffers: Integer overflow in drm_mode_create_ioctl()

2018-05-09 Thread Dan Carpenter
how we picked args->width that means cpp < UINT_MAX / 4. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Btw, DIV_ROUND_UP() integer overflows have been a recurring source of bugs so I have an unreleased static checker warning specific for that. This line triggers three w

[PATCH 3/3] drm/xen-front: Fix loop timeout

2018-05-08 Thread Dan Carpenter
If the loop times out then we want to exit with "to" set to zero, but in the current code it's set to -1. Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/

[PATCH 2/3] drm/xen-front: fix xen_drm_front_shbuf_alloc() error handling

2018-05-08 Thread Dan Carpenter
The xen_drm_front_shbuf_alloc() function was returning a mix of error pointers and NULL and the the caller wasn't checking correctly. I've changed it to always return error pointer consistently. Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend") Signed-o

[PATCH 1/3] drm/xen-front: checking for NULL instead of IS_ERR

2018-05-08 Thread Dan Carpenter
drm_dev_alloc() returns error pointers, it never returns NULL. Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_d

Re: [PATCH V1 3/5] backlight: qcom-wled: Add support for short circuit handling

2018-05-07 Thread Dan Carpenter
Hi Kiran, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on backlight/for-backlight-next] [also build test WARNING on v4.17-rc3 next-20180504] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

[radeon-alex:drm-next-4.18-wip 260/261] drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:1024 smu7_enable_sclk_mclk_dpm() warn: curly braces intended?

2018-04-29 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.18-wip head: 92fb37464bd2b759d74f33c3b90a27575601745d commit: c5eb46b78b52a40bc91421f667130fa7f328e97a [260/261] drm/amd/powerplay: add specific changes for VEGAM in smu7_hwmgr.c New smatch warnings:

[radeon-alex:drm-next-4.18-wip 201/261] drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c:194 pp_late_init() error: we previously assumed 'hwmgr' could be null (see line 185)

2018-04-29 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.18-wip head: 92fb37464bd2b759d74f33c3b90a27575601745d commit: cb2bd409128cdf4b6ac7779e55876956271be9f3 [201/261] drm/amd/powerplay: add control gfxoff enabling in late init smatch warnings:

[radeon-alex:amd-mainline-dkms-4.15 1231/1759] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2183 fill_plane_attributes() warn: if statement not indented

2018-04-26 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git amd-mainline-dkms-4.15 head: 9556f93f18f7923978fb90f860c107fed9ca7f57 commit: 265083076187e619aa9176aeb05ad630013429b4 [1231/1759] drm/amd/display: Hookup color management functions smatch warnings:

[radeon-alex:amd-mainline-dkms-4.15 1135/1759] drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1422 amdgpu_vm_bo_split_mapping() warn: if statement not indented

2018-04-26 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git amd-mainline-dkms-4.15 head: 9556f93f18f7923978fb90f860c107fed9ca7f57 commit: c756d628b20a12f50c43df1cfbe24fd72b5a47b4 [1135/1759] drm/amd/amdgpu: adapt dgma to the new vam_mgr smatch warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1422

Re: [PATCH] drm/amdkfd: Integer overflows in ioctl

2018-04-25 Thread Dan Carpenter
for this to be bigger than the number of GPUs in the system. The > maximum number of GPUs supported due to device minor limit in DRM is 128. > 128 is sort of a magic number. Is there a MAX_GPU define or something? regards, dan carpenter ___ dri-d

[PATCH] drm/amdkfd: Integer overflows in ioctl

2018-04-24 Thread Dan Carpenter
args->n_devices is a u32 that comes from the user. The multiplication could overflow on 32 bit systems possibly leading to privilege escalation. Fixes: 5ec7e02854b3 ("drm/amdkfd: Add ioctls for GPUVM memory management") Signed-off-by: Dan Carpenter dan.carpen...@oracle.com> diff

[radeon-alex:drm-next-4.18-wip 182/214] drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1571 amdgpu_vm_bo_update() error: we previously assumed 'bo' could be null (see line 1537)

2018-04-23 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.18-wip head: 52132fd03504140b4cc58c01b19e82929a03af7a commit: 7bcfcb8217c6ab4224c7de5074132f2185558b72 [182/214] drm/amdgpu: simplify bo_va list when vm bo update (v2) smatch warnings: drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1571

[radeon-alex:amd-staging-drm-next 170/201] drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu_helper.c:663 smu_set_watermarks_for_clocks_ranges() error: we previously assumed 'wm_with_clock_ranges' cou

2018-04-18 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next head: d64547a1cfa860e241b27723c88f86fa3d88d3d7 commit: d6c9a7dc86cd39146afb0f47c06b6f95d7dd4997 [170/201] drm/amd/pp: Move common code to smu_helper.c smatch warnings:

[PATCH] drm: omapdrm: silence unititialized variable warning

2018-04-18 Thread Dan Carpenter
en we return -ENOMEM. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/omapdrm/tcm-sita.c b/drivers/gpu/drm/omapdrm/tcm-sita.c index d7f7bc9f061a..817be3c41863 100644 --- a/drivers/gpu/drm/omapdrm/tcm-sita.c +++ b/drivers/gpu/drm/omapdrm/tcm-sita.c @@ -90,7 +90,7

Re: [PATCH] drm/amd/display: fix spelling mistake: "Usupported" -> "Unsupported"

2018-04-03 Thread Dan Carpenter
his. > > It's complex to have to remember the preferences for every subsystem. > Preferences should be expressed in the MAINTAINERS file in some way. > Also, since no one reads lkml, does it hurt to have even trivial patches? I always tell people not to CC lkml when there

[bug report] drm/vmwgfx: Cursor update fixes

2018-03-27 Thread Dan Carpenter
ot suitable for cursor\n"); 528 ret = -EINVAL; 529 } 530 531 return ret; 532 } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/gma500: simplify a condition in psbfb_mmap()

2018-03-23 Thread Dan Carpenter
Since we enforce that "vma->vm_pgoff" has to be zero it means we don't need an additional cap on the upper bound. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index cb0a2ae

[PATCH] drm/amd/pp: silence a static checker warning

2018-03-23 Thread Dan Carpenter
This has a static checker warning because "frev" and "crev" can be uninitialized if "info" is NULL. I just changed the order of the checks so that we check "info" first. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drive

[bug report] drm/stm: ltdc: add clut mode support

2018-02-22 Thread Dan Carpenter
ut; 392 u32 val; 393 int i; 394 395 if (!crtc || !crtc->state) Too late. 396 return; 397 regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesk

Re: [PATCH v2 5/5] drm: adv7511: Add support for i2c_new_secondary_device

2018-02-12 Thread Dan Carpenter
2c_client *i2c, const > struct i2c_device_id *id) > adv7511_audio_init(dev, adv7511); > return 0; > > +err_unregister_packet: > + i2c_unregister_device(adv7511->i2c_packet); > err_unregister_cec: > i2c_unregister_device(adv7511->i2c_cec

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Dan Carpenter
that Geert found where the right side wasn't a number literal. drivers/net/can/m_can/m_can.c:#define RXFC_FWM_MASK (0x7f < RXFC_FWM_SHIFT) drivers/usb/gadget/udc/goku_udc.h:#define INT_EPnNAK(n) (0x00100 < (n)) /* 0 < n < 4 */ regards, d

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Dan Carpenter
On Tue, Feb 06, 2018 at 02:15:51PM +0100, Julia Lawall wrote: > > > On Tue, 6 Feb 2018, Dan Carpenter wrote: > > > On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > > > In one Renesas driver, I found a typo which turned an intended bit shift > >

Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask

2018-02-06 Thread Dan Carpenter
- reissue_mask |= 0x < 4; + reissue_mask |= 0x << 4; regards, dan carpenter > Wolfram Sang (4): > v4l: vsp1: fix mask creation for MULT_ALPHA_RATIO > drm/exynos: fix comparison to bitshift when dealing with a mask >

[PATCH] drm/amd/powerplay: delete some dead code

2018-02-06 Thread Dan Carpenter
We deleted some code in e154162ef75d ("drm/amd/powerplay: refine pp code for raven") but there were a few related bits that were missed. Let's delete them as well. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b

[radeon-alex:drm-next-4.17-wip 151/209] drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:414 amdgpu_set_pp_od_clk_voltage() error: uninitialized symbol 'ret'.

2018-01-30 Thread Dan Carpenter
tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.17-wip head: 5d9e45135f05706b787fe2882442a78f92ae9cd1 commit: c0d382de6b810f9560a22d0d7e5837351265cd7b [151/209] drm/amd/pp: Add edit/commit/show OD clock/voltage support in sysfs smatch warnings:

[PATCH] drm/mgag200: fix a test in mga_vga_mode_valid()

2018-01-25 Thread Dan Carpenter
The parentheses are in the wrong place here so we pass the bits per pixel as zero. Fixes: abbee6238775 ("drm/mgag200: Added resolution and bandwidth limits for various G200e products.") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Static analysis. Not tes

[PATCH] drm/sun4i: Fix error code in sun4i_tcon_bind()

2018-01-15 Thread Dan Carpenter
We accidentally passed the wrong variable to PTR_ERR(). Fixes: a0c1214e4764 ("drm/sun4i: Add LVDS support") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index b78fed809992..3c1

Re: [PATCH 3/3] drm/amdgpu: Move to gtt before cpu accesses dma buf.

2018-01-10 Thread Dan Carpenter
Hi Samuel, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on drm/drm-next] [also build test WARNING on v4.15-rc7 next-20180110] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

[PATCH] drm/vmwgfx: Potential off by one in vmw_view_add()

2018-01-10 Thread Dan Carpenter
we can hit that error. But I don't have the hardware to test this code. Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c

[bug report] drm/vmwgfx: Add and connect plane helper functions

2017-12-14 Thread Dan Carpenter
466 struct vmw_private *dev_priv = vmw_priv(crtc->dev); ^ Unchecked dereference 467 struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(new_fb); 468 regards, dan carpenter

[PATCH] drm: mali-dp: Uninitialized variable in malidp_se_check_scaling()

2017-12-09 Thread Dan Carpenter
We use "mc" without initializing it if scaling is not necessary. Fixes: 28ce675b7474 ("drm: mali-dp: Add plane upscaling support") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_p

[PATCH] drm/fb-helper: Fix a potential NULL dereference

2017-12-06 Thread Dan Carpenter
We recently modified drm_fb_helper_single_add_all_connectors() to allow NULL "fb_helper" pointers. But the problem is that it gets dereferenced before we checked for NULL. Fixes: c777990fb45b ("drm/fb-helper: Handle function NULL argument") Signed-off-by: Dan Carpenter <d

[bug report] drm/vmwgfx: Initial DX support

2017-11-28 Thread Dan Carpenter
ret = vmw_cotable_notify(res, cmd->defined_id); 2743 vmw_resource_unreference(); 2744 if (unlikely(ret != 0)) 2745 return ret; 2746 regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedes

[PATCH] drm/tilcdc: uninitialized variable in tilcdc_get_overlay()

2017-11-13 Thread Dan Carpenter
The code seems to assume that of_fdt_unflatten_tree() sets "overlay" to NULL on error but actually it could be uninitialized. Fixes: 4e7221580223 ("drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding support") Signed-off-by: Dan Carpenter <dan.carpen...@

[PATCH] OMAPFB: prevent buffer underflow in omapfb_parse_vram_param()

2017-11-13 Thread Dan Carpenter
We cap the upper bound of "fbnum" but we also need to check for negatives or make the type unsigned. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c in

[PATCH] drm/amd/display: remove some unneeded code

2017-11-06 Thread Dan Carpenter
We assign "v_init = asic_blank_start;" a few lines earlier so there is no need to do it again inside the if statements. Also "v_init" is unsigned so it can't be less than zero. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gp

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

2017-11-06 Thread Dan Carpenter
backlight_device_register() never returns NULL, it returns error pointers on error so the check here is wrong. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

AMD, please run Smatch on your driver

2017-11-06 Thread Dan Carpenter
selves because it scales better than relying on me to do it. regards, dan carpenter drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:2224 amdgpu_device_init() warn: 'adev->rio_mem' was not released on error drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:2395 amdgpu_device_init() warn: 'adev->rio_mem' was

Re: video: atmel_lcdfb: Use common error handling code in atmel_lcdfb_of_init()

2017-11-06 Thread Dan Carpenter
e string constant twice. > > Do you distinguish between merging of constants and the combination > of statements for such an use case? I would have rejected the patch even if GCC didn't combine the strings because the most important thing is that

Re: [PATCH] video: atmel_lcdfb: Use common error handling code in atmel_lcdfb_of_init()

2017-11-06 Thread Dan Carpenter
On Mon, Nov 06, 2017 at 09:40:19AM +0100, Nicolas Ferre wrote: > If you want to lower the size of strings in this driver, you can do it, > but not like this. Just so we're clear, GCC already detects and combines it when you use the same string constant twice. regards, dan car

[PATCH] drm/amd/display: small cleanup in destruct()

2017-11-05 Thread Dan Carpenter
not really appropriate here so it should be removed as well. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- v2: in v1 I just added a tab diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c index d91159

Re: [PATCH] drm/amd/display: indent an if statement

2017-11-05 Thread Dan Carpenter
On Sat, Nov 04, 2017 at 10:16:23AM +0100, walter harms wrote: > > > Am 04.11.2017 07:12, schrieb Dan Carpenter: > > The if statement wasn't indented so it makes static analysis tools and > > probably very recent GCC versions complain. > > > > Signed-

[PATCH] drm/amd/display: indent an if statement

2017-11-04 Thread Dan Carpenter
The if statement wasn't indented so it makes static analysis tools and probably very recent GCC versions complain. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- I went over 80 characters because other lines do already and it seemed like the cleanest thing here. diff --git a/d

[PATCH] omapdrm: hdmi4_cec: signedness bug in hdmi4_cec_init()

2017-10-27 Thread Dan Carpenter
"ret" needs to be signed for the error handling to work. Fixes: 8d7f934df8d8 ("omapdrm: hdmi4_cec: add OMAP4 HDMI CEC support") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c b/drivers/gpu/drm/oma

Re: Unicode characters in commit messages?

2017-10-25 Thread Dan Carpenter
ck not sufficient so far to reach > a final consensus. Markus, you really have to listen better or you're going to get banned from more subsystems. These long email threads are a waste of time when we already answered your questions completely and over and over. The feedbac

Re: drm/rcar-du: Adjust 14 checks for null pointers

2017-10-25 Thread Dan Carpenter
> >> > > > > This one is fine > > This kind of feedback is nice. > > > > except for the commit message. > > Would you like to support Unicode characters there? > Multiple people have answered this question already and I have answered it multiple time

Re: [PATCH 2/2] drm/rcar-du: Adjust 14 checks for null pointers

2017-10-25 Thread Dan Carpenter
ipt “checkpatch.pl” pointed information out like the following. > > Comparison to NULL could be written !… > > Thus fix the affected source code places. > This one is fine except for the commit message. regards, dan carpenter __

Re: [PATCH 1/2] drm/rcar-du: Use common error handling code in rcar_du_encoders_init()

2017-10-25 Thread Dan Carpenter
goto free_three; } Of course, having a big unlock label makes sense if you take a lock at the start of the function and need to drop it at the end. But in this case we are taking a lock then dropping it, and taking the next, then dropping it and so on. It's a different situation. regard

Re: drm/i915/gvt: Use common error handling code in shadow_workload_ring_buffer()

2017-10-24 Thread Dan Carpenter
out of three error messages happened to be the same and Markus wants to save a bit of memory by using the same string. The memory savings is not so big that it's worth making the code less readable. regards, dan carpenter ___ dri-devel mailing list dri

Re: [PATCH] drm/amd/powerplay: fix amd_powerplay_reset()

2017-10-24 Thread Dan Carpenter
On Tue, Oct 24, 2017 at 01:11:07PM +0300, Jani Nikula wrote: > On Tue, 24 Oct 2017, Dan Carpenter <dan.carpen...@oracle.com> wrote: > > We accidentally inverted an if statement and turned amd_powerplay_reset() > > into a no-op. > > > > Fixes: ae97988fc89e ("

[PATCH] drm/amd/powerplay: fix amd_powerplay_reset()

2017-10-24 Thread Dan Carpenter
We accidentally inverted an if statement and turned amd_powerplay_reset() into a no-op. Fixes: ae97988fc89e ("drm/amd/powerplay: tidy up ret checks in amd_powerplay.c (v3)") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- IMHO, tidying unreadable double negatives is

Re: [PATCH] gpu/drm/bridge/sii9234: Use common error handling code in sii9234_writebm()

2017-10-23 Thread Dan Carpenter
r < 0 but you're doing it again. And it introduces a bug, although I see now that you fixed it in v2. I can't get excited about these sort of risky low value patches. > > +report_failure: > + dev_err(ctx->dev, "writebm: %4s[0x%02x] <- 0x%02x\n", > + sii9234_client_name[id], offset, value); > + ctx->i2c_error = ret; > return ret; > } regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/panel: rpi-touchscreen: propagate errors in rpi_touchscreen_i2c_read()

2017-10-19 Thread Dan Carpenter
Pi 7" Touchscreen.") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c index 890fd6ff397c..d964d454e4ae 100644 --- a/drivers/gpu/drm/panel/panel-raspberryp

[PATCH] drm/bridge: adv7511: Fix a use after free

2017-10-17 Thread Dan Carpenter
We free "edid", then use it again on the next line. Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv751

Re: [PATCH 6/8] video: fbdev: au1200fb: Remove some dead code

2017-10-17 Thread Dan Carpenter
0; Heh... It looks like they were deliberately silencing the warning about the bug you fixed in patch 2/8. :P regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] pci: Fix a possible sleep-in-atomic bug in pci_set_power_state

2017-10-11 Thread Dan Carpenter
inlock held warnings. Otherwise you'd have to hit the deadlock and you have to be pretty unlucky to hit it so these bugs sometimes do go unreported for a long time. regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org

[PATCH] drm/kirin: Checking for IS_ERR() instead of NULL

2017-10-05 Thread Dan Carpenter
The of_graph_get_remote_node() function doesn't return error pointers, it returns NULL on error so I've updated the check. Fixes: 86418f90a4c1 ("drm: convert drivers to use of_graph_get_remote_node") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/g

[PATCH 2/2] drm/amdgpu: Potential uninitialized variable in amdgpu_vm_update_directories()

2017-09-30 Thread Dan Carpenter
t;r" to zero at the start. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index bbcc67038203..fb3afab55907 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/a

[PATCH 1/2] drm/amdgpu: potential uninitialized variable in amdgpu_vce_ring_parse_cs()

2017-09-30 Thread Dan Carpenter
also possible I may have missed something. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c index b46280c1279f..2918de2f39ec 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +++ b/

[PATCH] drm: of: always initialize panel in drm_of_find_panel_or_bridge()

2017-09-25 Thread Dan Carpenter
The callers expect "panel" to be initialized, but that isn't true if we return -ENODEV. It causes bugs like: drivers/gpu/drm/tve200/tve200_drv.c:83 tve200_modeset_init() error: uninitialized symbol 'panel'. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff

[PATCH] drm/tve200: Check for IS_ERR instead of NULL in probe

2017-09-25 Thread Dan Carpenter
devm_ioremap_resource() returns error pointer, it never returns NULL on error. Fixes: 179c02fe90a4 ("drm/tve200: Add new driver for TVE200") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tv

[bug report] drm/pl111: Replace custom connector with panel bridge

2017-09-22 Thread Dan Carpenter
^^^ but it also adds a new dereference. 131 132 ret = drm_vblank_init(dev, 1); regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm: qxl: ratelimit pr_info message, reduce log spamming

2017-09-12 Thread Dan Carpenter
On Tue, Sep 12, 2017 at 03:02:04PM +0100, Emil Velikov wrote: > That said, I'm not sure how useful the information is - perhaps it's > better to drop it all together? Or a WARN_ONCE(). regards, dan carpenter ___ dri-devel mailing list dri

[PATCH 2/2] drm/amdgpu/ci: tidy up some limit checks

2017-08-22 Thread Dan Carpenter
ISCRETE_MC_REGISTER_ARRAY_SIZE". The "table->last" value can't possibly be greater than the array size and it is allowed to be equal to it. So let's just remove that test entirely. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Not tested. Please review this one care

[PATCH 1/2] drm/radeon/ci: tidy up some limit checks

2017-08-22 Thread Dan Carpenter
ISCRETE_MC_REGISTER_ARRAY_SIZE". The "table->last" value can't possibly be greater than the array size and it is allowed to be equal to it. So let's just remove that test entirely. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Not tested. Please review this one c

Re: [PATCH v2] drm/i915: Fix integer overflow tests

2017-08-18 Thread Dan Carpenter
On Fri, Aug 18, 2017 at 08:46:25AM +0100, Chris Wilson wrote: > Quoting Dan Carpenter (2017-08-18 08:07:00) > > There are some potential integer overflows here on 64 bit systems. > > > > The condition "if (nfences > SIZE_MAX / sizeof(*fences))" can only be > &

[PATCH v2] drm/i915: Fix integer overflow tests

2017-08-18 Thread Dan Carpenter
loc_array(args->buffer_count + 1, sz, ^^ Originally, those two integer overflow checks were against UINT_MAX instead of SIZE_MAX and this patch changes them back. Fixes: 2889caa92321 ("drm/i915: Eliminate lots of iterations over the exec

Re: [PATCH] drm/i915: Fix integer overflow tests

2017-08-17 Thread Dan Carpenter
On Thu, Aug 17, 2017 at 07:16:03AM -0700, Jason Ekstrand wrote: > On Thu, Aug 17, 2017 at 2:56 AM, Imre Deak <imre.d...@intel.com> wrote: > > > On Thu, Aug 17, 2017 at 12:50:37PM +0300, Dan Carpenter wrote: > > > On Thu, Aug 17, 2017 at 12:37:00PM +0300, Imre Deak wr

Re: [PATCH] drm/i915: Fix integer overflow tests

2017-08-17 Thread Dan Carpenter
On Thu, Aug 17, 2017 at 12:37:00PM +0300, Imre Deak wrote: > On Thu, Aug 17, 2017 at 09:23:10AM +0300, Dan Carpenter wrote: > > There are some potential integer overflows here on 64 bit systems. > > > > The condition "if (nfences > SIZE_MAX / sizeof(*fences))&qu

[PATCH] drm/i915: Fix integer overflow tests

2017-08-17 Thread Dan Carpenter
flow if it's set to UINT_MAX when we do: exec2_list = kvmalloc_array(args->buffer_count + 1, sz, ^^ Fixes: 2889caa92321 ("drm/i915: Eliminate lots of iterations over the execobjects array") Signed-off-by: Dan Carpenter <

[PATCH] drm/omap: Potential NULL deref in omap_crtc_duplicate_state()

2017-08-11 Thread Dan Carpenter
If the kmalloc() fails then we dereference "state" when we set "state->zpos". Fixes: 3dfeb631a15d ("drm/omap: Rework the rotation-on-crtc hack") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/dr

[PATCH] drm/msm: Error pointer dereference in error handling

2017-08-11 Thread Dan Carpenter
"gpu->aspace" can be either an error pointer or NULL so we need to check for both. Fixes: 0dbd7327f4d5 ("drm/msm: Move memptrs to msm_gpu") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm

Re: [PATCH] drm: Shift wrap bug in create_in_format_blob()

2017-08-10 Thread Dan Carpenter
On Wed, Aug 09, 2017 at 03:38:33PM +0100, Daniel Stone wrote: > On 9 August 2017 at 15:36, Sean Paul <seanp...@chromium.org> wrote: > > On Wed, Aug 09, 2017 at 02:19:06PM +0300, Dan Carpenter wrote: > >> "plane->format_count" can go up to 64. (It's capped in

Re: [PATCH] drm/amdgpu: potential shift wrapping bug

2017-08-10 Thread Dan Carpenter
On Thu, Aug 10, 2017 at 03:02:53PM +0200, Christian König wrote: > Am 10.08.2017 um 14:53 schrieb Dan Carpenter: > > On Thu, Aug 10, 2017 at 02:30:15PM +0200, Christian König wrote: > > > Am 10.08.2017 um 14:16 schrieb Dan Carpenter: > > > > "frag_align"

Re: [PATCH] drm/amdgpu: potential shift wrapping bug

2017-08-10 Thread Dan Carpenter
On Thu, Aug 10, 2017 at 02:30:15PM +0200, Christian König wrote: > Am 10.08.2017 um 14:16 schrieb Dan Carpenter: > > "frag_align" is a u64, so presumably we want to use the high bits as > > well instead of shift wrapping. > > > > Fixes: 6be7adb37d9b (&qu

Re: [PATCH] drm/amdgpu: potential shift wrapping bug

2017-08-10 Thread Dan Carpenter
On Thu, Aug 10, 2017 at 02:30:15PM +0200, Christian König wrote: > Am 10.08.2017 um 14:16 schrieb Dan Carpenter: > > "frag_align" is a u64, so presumably we want to use the high bits as > > well instead of shift wrapping. > > > > Fixes: 6be7adb37d9b (&qu

[PATCH] drm/amdgpu: potential shift wrapping bug

2017-08-10 Thread Dan Carpenter
"frag_align" is a u64, so presumably we want to use the high bits as well instead of shift wrapping. Fixes: 6be7adb37d9b ("drm/amdgpu: increase fragmentation size for Vega10 v2") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm

[PATCH] drm: Shift wrap bug in create_in_format_blob()

2017-08-09 Thread Dan Carpenter
"plane->format_count" can go up to 64. (It's capped in drm_universal_plane_init().) So we should be using ULL type instead of int here to prevent shift wrapping. Fixes: db1689aa61bd ("drm: Create a format/modifier blob") Signed-off-by: Dan Carpenter <dan.carpen.

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