[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

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

[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

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

[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 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] 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/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,

[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

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

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

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

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

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

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

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

[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

[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

[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

[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

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

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

[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

[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

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

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

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

[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

[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

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

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

[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

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.

[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

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

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

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

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

[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

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

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

[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

[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

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

[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

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

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:

[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

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

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

[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

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

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

[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

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

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

[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

[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

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

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