[PATCH 5/5 v4] accel/qaic: Fix a leak in map_user_pages()

2023-07-11 Thread Dan Carpenter
If get_user_pages_fast() allocates some pages but not as many as we wanted, then the current code leaks those pages. Call put_page() on the pages before returning. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter --- no change drivers/accel/qaic/qaic

[PATCH 4/5 v4] accel/qaic: move and expand integer overflow checks for map_user_pages()

2023-07-11 Thread Dan Carpenter
Move the check to find_and_map_user_pages() instead and add some more additional potential integer overflow checks. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter --- no change drivers/accel/qaic/qaic_control.c | 9 ++--- 1 file changed, 6 i

[PATCH 3/5 v4] accel/qaic: Add consistent integer overflow checks

2023-07-11 Thread Dan Carpenter
. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter --- v2: no change drivers/accel/qaic/qaic_control.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/accel/qaic/qaic_control.c b/drivers/accel/qaic/qaic_contr

[PATCH 2/5 v4] accel/qaic: tighten bounds checking in decode_message()

2023-07-11 Thread Dan Carpenter
't corrupt memory in decode_passthrough() when we do. memcpy(out_trans->data, in_trans->data, len - sizeof(in_trans->hdr)); And finally, use size_add() to prevent an integer overflow: if (size_add(msg_len, hdr_len) > msg_hdr_len) Fixes: 129776ac2e38 ("accel/q

[PATCH 1/5 v4] accel/qaic: tighten bounds checking in encode_message()

2023-07-11 Thread Dan Carpenter
al concern is that the "user_len + trans_hdr->len" might have an integer overflow bug. Use size_add() to prevent that. - if (user_len + trans_hdr->len > user_msg->len) { + if (size_add(user_len, trans_hdr->len) > user_msg->len) { Fixes: 129776ac2e38 (&quo

[PATCH 0/5 v4] accel/qaic: Improve bounds checking in encode/decode

2023-07-11 Thread Dan Carpenter
Fixed in v4: Send the correct [PATCH 1/5] patch. Fixed in v3: Redo messed up threading Fixed two things in v2: Include the file. Change the >= in encode and decode to >. regards, dan carpenter

Re: [PATCH 1/5 v3] accel/qaic: tighten bounds checking in encode_message()

2023-07-10 Thread Dan Carpenter
NAK. Wow. I really screwed this up. I didn't mean to send this patch. I have a correct patch still sitting in my postponed messages. I will send v4 in twenty minutes. regards, dan carpenter

[PATCH] phy: phy-mtk-dp: Fix an error code in probe()

2023-07-10 Thread Dan Carpenter
Negative -EINVAL was intended instead of positive EINVAL. Fixes: 6a23afad443a ("phy: phy-mtk-dp: Add driver for DP phy") Signed-off-by: Dan Carpenter --- drivers/phy/mediatek/phy-mtk-dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/mediatek/phy-m

[PATCH 5/5 v3] accel/qaic: Fix a leak in map_user_pages()

2023-07-10 Thread Dan Carpenter
If get_user_pages_fast() allocates some pages but not as many as we wanted, then the current code leaks those pages. Call put_page() on the pages before returning. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter --- no change drivers/accel/qaic/qaic

[PATCH 4/5 v3] accel/qaic: move and expand integer overflow checks for map_user_pages()

2023-07-10 Thread Dan Carpenter
Move the check to find_and_map_user_pages() instead and add some more additional potential integer overflow checks. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter --- no change drivers/accel/qaic/qaic_control.c | 9 ++--- 1 file changed, 6 i

[PATCH 3/5 v3] accel/qaic: Add consistent integer overflow checks

2023-07-10 Thread Dan Carpenter
. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter --- v2: no change drivers/accel/qaic/qaic_control.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/accel/qaic/qaic_control.c b/drivers/accel/qaic/qaic_contr

[PATCH 2/5 v3] accel/qaic: tighten bounds checking in decode_message()

2023-07-10 Thread Dan Carpenter
't corrupt memory in decode_passthrough() when we do. memcpy(out_trans->data, in_trans->data, len - sizeof(in_trans->hdr)); And finally, use size_add() to prevent an integer overflow: if (size_add(msg_len, hdr_len) > msg_hdr_len) Fixes: 129776ac2e38 ("accel/q

[PATCH 1/5 v3] accel/qaic: tighten bounds checking in encode_message()

2023-07-10 Thread Dan Carpenter
al concern is that the "user_len + trans_hdr->len" might have an integer overflow bug. Use size_add() to prevent that. - if (user_len + trans_hdr->len > user_msg->len) { + if (size_add(user_len, trans_hdr->len) > user_msg->len) { Fixes: 129776ac2e38 (&quo

[PATCH 0/5 v3] accel/qaic: Improve bounds checking in encode/decode

2023-07-10 Thread Dan Carpenter
Fixed in v3: Redo messed up threading Fixed two things in v2: Include the file. Change the >= in encode and decode to >. regards, dan carpenter

Re: [PATCH 1/5] accel/qaic: tighten bounds checking in encode_message()

2023-07-10 Thread Dan Carpenter
Oops. Left the v2 out of the subject. Let me start this whole thread over... regards, dan carpenter

[PATCH 1/5] accel/qaic: tighten bounds checking in encode_message()

2023-07-10 Thread Dan Carpenter
al concern is that the "user_len + trans_hdr->len" might have an integer overflow bug. Use size_add() to prevent that. - if (user_len + trans_hdr->len > user_msg->len) { + if (size_add(user_len, trans_hdr->len) > user_msg->len) { Fixes: 129776ac2e38 (&quo

[PATCH 0/5 v2] accel/qaic: Improve bounds checking in encode/decode

2023-07-10 Thread Dan Carpenter
Fixed two things in v2: Include the file. Change the >= in encode and decode to >. regards, dan carpenter

Re: [drm-misc:drm-misc-next 2/3] drivers/gpu/drm/loongson/lsdc_plane.c:199 lsdc_cursor_plane_atomic_async_check() warn: variable dereferenced before check 'state' (see line 180)

2023-07-10 Thread Dan Carpenter
ated emails from the kbuild (zero day) bot. I just look them over and hit forward. regards, dan carpenter

[drm-misc:drm-misc-next 2/3] drivers/gpu/drm/loongson/lsdc_plane.c:199 lsdc_cursor_plane_atomic_async_check() warn: variable dereferenced before check 'state' (see line 180)

2023-07-09 Thread Dan Carpenter
patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202307100423.rv7d05uq-...@intel.com/ smatch warnings: drivers/gpu/drm/loongson/lsdc_plane.c:199 lsdc_cursor_plane_atomic_async_check() warn: variable

Re: [PATCH] dma-buf: fix an error pointer vs NULL bug

2023-07-06 Thread Dan Carpenter
On Thu, Jul 06, 2023 at 08:21:35AM +0200, Christian König wrote: > Am 06.07.23 um 07:52 schrieb Dan Carpenter: > > The __dma_fence_unwrap_merge() function is supposed to return NULL on > > error. But the dma_fence_allocate_private_stub() returns error pointers > > so check fo

[PATCH v2] dma-buf: fix an error pointer vs NULL bug

2023-07-06 Thread Dan Carpenter
e expected NULL pointers. Change it to return NULL and update the caller which expected error pointers, drm_syncobj_assign_null_handle(), to check for NULL instead. Fixes: f781f661e8c9 ("dma-buf: keep the signaling time of merged fences v3") Signed-off-by: Dan Carpente

[PATCH] dma-buf: fix an error pointer vs NULL bug

2023-07-05 Thread Dan Carpenter
: f781f661e8c9 ("dma-buf: keep the signaling time of merged fences v3") Signed-off-by: Dan Carpenter --- drivers/dma-buf/dma-fence-unwrap.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/dma-buf/dma-fence-unwrap.c b/drivers/dma-buf/dma-fence-unwr

Re: [PATCH 1/5] accel/qaic: tighten bounds checking in encode_message()

2023-07-04 Thread Dan Carpenter
On Tue, Jul 04, 2023 at 03:18:26PM +0530, Pranjal Ramajor Asha Kanojiya wrote: > > > On 7/4/2023 2:08 PM, Dan Carpenter wrote: > > On Tue, Jul 04, 2023 at 11:57:51AM +0530, Pranjal Ramajor Asha Kanojiya > > wrote: > > > > diff --git a/drivers/accel/qaic/qaic_c

Re: [PATCH 1/5] accel/qaic: tighten bounds checking in encode_message()

2023-07-04 Thread Dan Carpenter
;) Those are two separate conditions so I put them on two lines. If it were something very related like if (x < 0 || x >= 10) then I would have put it on one line. regards, dan carpenter

Re: [PATCH 1/5] accel/qaic: tighten bounds checking in encode_message()

2023-07-04 Thread Dan Carpenter
break; > > } > > trans_hdr = (struct qaic_manage_trans_hdr *)(user_msg->data + > > user_len); > > - if (user_len + trans_hdr->len > user_msg->len) { > > + if (trans_hdr->len < sizeof(trans_hdr) || > > + size_add(user_len, trans_hdr->len) > user_msg->len) { If we change to > then the == will be caught by this check. So it doesn't affect runtime either way. regards, dan carpenter

Re: [Intel-gfx] [PATCH 16/26] drm/i915/gvt: use array_size

2023-06-26 Thread Dan Carpenter
user doesn't > know that a truncation has happened. So that if we save from an > overflow here, we might encur to an unwanted access later when we > would start using the array for the size we think is allocated. SIZE_MAX allocations are guaranteed to fail, so the NULL check will still return -ENOMEM. > > kmalloc_array(), for example, returns NULL of there is a > multiplication overflow and I think that's a better behaviour, > although more drastic. It's the same either way. regards, dan carpenter

Re: [PATCH 1/5] accel/qaic: tighten bounds checking in encode_message()

2023-06-22 Thread Dan Carpenter
On Thu, Jun 22, 2023 at 02:43:57PM +0300, Dan Carpenter wrote: > > > - if (!user_msg->count) { > > > + if (!user_msg->count || > > > + user_msg->len < sizeof(*trans_hdr)) { > > Can we have something like this here > > user_msg->len <

Re: [PATCH 1/5] accel/qaic: tighten bounds checking in encode_message()

2023-06-22 Thread Dan Carpenter
On Thu, Jun 22, 2023 at 04:54:03PM +0530, Pranjal Ramajor Asha Kanojiya wrote: > > > On 6/21/2023 12:51 PM, Dan Carpenter wrote: > > There are several issues in this code. The check at the start of the > > loop: > > > > if (user_len >= user_msg->len

Re: [PATCH 0/5] accel/qaic: Improve bounds checking in encode/decode

2023-06-22 Thread Dan Carpenter
On Wed, Jun 21, 2023 at 08:53:41PM -0600, Jeffrey Hugo wrote: > On 6/21/2023 1:21 AM, Dan Carpenter wrote: > > (I think this is the first cover letter I have ever written). > > > > These patches are based on review and not from testing. > > Thank you for your review.

[PATCH 5/5] accel/qaic: Fix a leak in map_user_pages()

2023-06-21 Thread Dan Carpenter
If get_user_pages_fast() allocates some pages but not as many as we wanted, then the current code leaks those pages. Call put_page() on the pages before returning. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter --- drivers/accel/qaic/qaic_con

[PATCH 4/5] accel/qaic: move and expand integer overflow checks for map_user_pages()

2023-06-21 Thread Dan Carpenter
Move the check to find_and_map_user_pages() instead and add some more additional potential integer overflow checks. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter --- I kind of went to town adding integer overflow checks here. Please, review this

[PATCH 3/5] accel/qaic: Add consistent integer overflow checks

2023-06-21 Thread Dan Carpenter
. Fixes: 129776ac2e38 ("accel/qaic: Add control path") Signed-off-by: Dan Carpenter --- drivers/accel/qaic/qaic_control.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/accel/qaic/qaic_control.c b/drivers/accel/qaic/qaic_control.c index 78

[PATCH 2/5] accel/qaic: tighten bounds checking in decode_message()

2023-06-21 Thread Dan Carpenter
't corrupt memory in decode_passthrough() when we do. memcpy(out_trans->data, in_trans->data, len - sizeof(in_trans->hdr)); And finally, use size_add() to prevent an integer overflow: if (size_add(msg_len, hdr_len) > msg_hdr_len) Fixes: 129776ac2e38 ("accel/q

[PATCH 1/5] accel/qaic: tighten bounds checking in encode_message()

2023-06-21 Thread Dan Carpenter
al concern is that the "user_len + trans_hdr->len" might have an integer overflow bug. Use size_add() to prevent that. - if (user_len + trans_hdr->len > user_msg->len) { + if (size_add(user_len, trans_hdr->len) > user_msg->len) { Fixes: 129776ac2e38 (&quo

[PATCH 0/5] accel/qaic: Improve bounds checking in encode/decode

2023-06-21 Thread Dan Carpenter
which indicates deep distrust. What I'm saying is that there may be more issues in this code. But also that I don't really understand it so please review carefully. The patch that I'm least sure of is 4/5: [PATCH 4/5] accel/qaic: move and expand integer overflow checks for map_user_pages() regards, dan carpenter

Re: [PATCH] drm/amd/amdgpu: Use “__packed“ instead of "pragma pack()"

2023-06-20 Thread Dan Carpenter
return r; Smatch complains that we don't necessarily enter the loop. I think I'm going to disable this type of "enter the loop" warning when you don't have the cross function database available. That will silence these for the kbuild bot. regards, dan carpenter Hi

Re: [PATCH] drm/amd/amdgpu: Properly tune the size of struct

2023-06-20 Thread Dan Carpenter
On Tue, Jun 20, 2023 at 10:37:59AM +0300, Dan Carpenter wrote: > "Mark the associated types properly packed individually, rather than > use the disgusting "pragma pack()" that should never be used." > > https://lore.kernel.org/linux-sparse/CAHk-=wi7jgz+bvb

Re: [PATCH] drm/amd/amdgpu: Properly tune the size of struct

2023-06-20 Thread Dan Carpenter
"Mark the associated types properly packed individually, rather than use the disgusting "pragma pack()" that should never be used." https://lore.kernel.org/linux-sparse/CAHk-=wi7jgz+bvbt-ufxokpeqdhzf3z2hbjkgdjh8q4dvpp...@mail.gmail.com/ regards, dan carpenter

[PATCH] drm/sprd: Remove unnecessary variable in calc_video_size_step()

2023-06-19 Thread Dan Carpenter
The "video_size_step" variable is never used so it can be removed. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/sprd/sprd_dsi.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/sprd/sprd_dsi.c b/drivers/gpu/drm/sprd/sprd_dsi.c index ab

Re: [PATCH v2 01/38] backlight/bd6107: Compare against struct fb_info.device

2023-06-12 Thread Dan Carpenter
or a long time without seeing the fix. Then I misunderstood Sam's review comments (my fault, they were clear in retrospect) so I got completely lost. regards, dan carpenter

Re: [PATCH v5 11/11] drm/mediatek: gamma: Program gamma LUT type for descending or rising

2023-06-09 Thread Dan Carpenter
| Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202306101458.lrxhee0z-...@intel.com/ smatch warnings: drivers/gpu/drm/mediatek/mtk_disp_gamma.c:192 mtk_gamma_set_common() error: we previously assumed 'gamma->data' could be null (see line 1

Re: [PATCH] drm/msm/dpu: tidy up some error checking

2023-06-08 Thread Dan Carpenter
On Thu, Jun 08, 2023 at 02:26:14AM +0300, Dmitry Baryshkov wrote: > On 07/06/2023 17:42, Dan Carpenter wrote: > > On Tue, Jun 06, 2023 at 10:23:46PM +0200, Marijn Suijten wrote: > > > > @@ -359,8 +359,8 @@ static void dpu_encoder_phys_cmd_tearcheck_config( > > > >

[PATCH v2] drm/msm/dpu: tidy up some error checking

2023-06-08 Thread Dan Carpenter
d long as well and change the error checking to check for zero instead of negatives. This change does not affect runtime at all beyond a minor adjustment to the debug output. Suggested-by: Marijn Suijten Signed-off-by: Dan Carpenter Reviewed-by: Marijn Suijten --- v2: update the debug output

Re: [PATCH] drm/msm/dpu: tidy up some error checking

2023-06-07 Thread Dan Carpenter
vsync_hz); > > Nit: no need to print the value here, you know it's zero. Could be > clarified to just "no vsync clock". > Yeah. That's obviously not useful. Sorry, I will resend. regards, dan carpenter

[PATCH] drm/msm/dpu: tidy up some error checking

2023-06-06 Thread Dan Carpenter
d long as well and change the error checking to check for zero instead of negatives. This change does not affect runtime at all. It's just a clean up. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 8 1 file changed, 4 insertions(+), 4 dele

Re: [PATCH 02/30] backlight/gpio_backlight: Compare against struct fb_info.device

2023-06-06 Thread Dan Carpenter
gt; > > > Would a fixes: be useful? > > That would be commit 8b770e3c9824 ("backlight: Add GPIO-based backlight > driver") from 2013. Maybe a bit old already, but I can surely add it. Don't add the Fixes tag to this one because it doesn't fix anything, it just renames stuff. The real fix is later? To be honest, it was kind of difficult to see where the actual fix was. Fixes tags for old code is fine... I like to know why bugs are introduced. Was it adding a feature or part of fix for something else or a cleanup? regards, dan carpenter

Re: [PATCH 18/30] fbdev/radeonfb: Use hardware device as backlight parent

2023-06-05 Thread Dan Carpenter
-off-by: Thomas Zimmermann > Benjamin Herrenschmidt You left out the Cc: regards, dan carpenter

Re: [PATCH 11/30] fbdev/ep93xx-fb: Do not assign to struct fb_info.dev

2023-06-05 Thread Dan Carpenter
ver incorrectly decreases the hardware > device's reference counter and leaks the fbdev device. > > Signed-off-by: Thomas Zimmermann Fixes: 88017bda96a5 ("ep93xx video driver") regards, dan carpenter

Re: [PATCH] drm/i915/selftests: Add some missing error propagation

2023-06-05 Thread Dan Carpenter
grep line to their scripts to solve that problem. Instead we were having the opposite discussion the other week where the bpf people didn't want to backport selftest stuff and Greg wanted to. https://lore.kernel.org/all/2023052647-tacking-wince-85c5@gregkh/ regards, dan carpenter

Re: [PATCH] drm/nouveau/nvif: use struct_size()

2023-05-31 Thread Dan Carpenter
nteger overflow checking. > if (!(args = kmalloc(size, GFP_KERNEL))) > return -ENOMEM; > args->ioctl.version = 0; regards, dan carpenter

[bug report] drm: Track drm_mm allocators and show leaks on shutdown

2023-05-30 Thread Dan Carpenter
r drm_mm_takedown() are holding spinlocks so it's a sleeping in atomic bug. The problematic callers are ttm_range_man_fini_nocheck() and amdgpu_gtt_mgr_fini(). 1002 } regards, dan carpenter

[bug report] vga_switcheroo: set audio client id according to bound GPU id

2023-05-26 Thread Dan Carpenter
_client(pdev, ops, id | ID_BIT_AUDIO, vga_dev, 389 false, true); 390 } regards, dan carpenter

[PATCH v2] drm/msm/dpu: clean up dpu_kms_get_clk_rate() returns

2023-05-26 Thread Dan Carpenter
Static analysis tools complain about the -EINVAL error code being stored in an unsigned variable. Let's change this to match the clk_get_rate() function which is type unsigned long and returns zero on error. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by

[drm-misc:for-linux-next 5/10] drivers/gpu/drm/drm_file.c:967 drm_show_memory_stats() error: uninitialized symbol 'supported_status'.

2023-05-25 Thread Dan Carpenter
the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202305260440.7dv6fzhq-...@intel.com/ smatch warnings: drivers/gpu/drm/drm_file.c:967 drm_show_memory_stats() error: uninitialized symbol

[PATCH] drm/amd/amdgpu: Fix up locking etc in amdgpu_debugfs_gprwave_ioctl()

2023-05-25 Thread Dan Carpenter
/amdgpu: Update debugfs for XCC support (v3)") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c ind

Re: [PATCH] drm/msm/dpu: signedness bug in dpu_encoder_phys_cmd_tearcheck_config()

2023-05-23 Thread Dan Carpenter
On Mon, May 22, 2023 at 10:47:50AM +0200, Marijn Suijten wrote: > On 2023-05-22 10:48:01, Dan Carpenter wrote: > > The "vsync_hz" variable is used to store negative error codes so it > > needs to be signed for the error checking to work correctly. > > Nicely spotte

Re: [PATCH 1/4] accel/habanalabs: remove sim code

2023-05-22 Thread Dan Carpenter
idx, dev_name(&(hdev)->pdev->dev)); ^^^ I hate to be picky, but would it be too much to get rid of the parens around (hdev)? regards, dan carpenter

[bug report] habanalabs: extend fatal messages to contain PCI info

2023-05-22 Thread Dan Carpenter
ot;, 2337 hdev->cdev_idx, dev_name(&(hdev)->pdev->dev)); ^^ "hdev->pdev" is NULL here so this will crash. 2338 2339 return rc; 2340 } regards, dan carpenter

[PATCH] drm/msm/dpu: signedness bug in dpu_encoder_phys_cmd_tearcheck_config()

2023-05-22 Thread Dan Carpenter
The "vsync_hz" variable is used to store negative error codes so it needs to be signed for the error checking to work correctly. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c |

Re: [PATCH] drm/amdgpu: remove unnecessary (void*) conversions

2023-05-15 Thread Dan Carpenter
On Mon, May 15, 2023 at 10:11:39AM -0400, Alex Deucher wrote: > On Mon, May 15, 2023 at 3:17 AM Dan Carpenter > wrote: > > > > On Mon, May 15, 2023 at 09:34:28AM +0800, Su Hui wrote: > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c > &g

[PATCH] accel/habanalabs: fix gaudi2_get_tpc_idle_status() return

2023-05-15 Thread Dan Carpenter
The gaudi2_get_tpc_idle_status() function returned the incorrect variable so it always returned true. Fixes: d85f0531b928 ("accel/habanalabs: break is_idle function into per-engine sub-routines") Signed-off-by: Dan Carpenter --- >From static analysis. Not tested. drivers/acc

Re: [PATCH] drm/amdgpu: remove unnecessary (void*) conversions

2023-05-15 Thread Dan Carpenter
u probably want to change the order now that the lengths have changed. Same in the other places as well. regards, dan carpenter

[bug report] drm: Use the state pointer directly in planes atomic_check

2023-05-14 Thread Dan Carpenter
plane_state(new_plane_state, crtc_state, 1040, 105 INT_MAX, true, false); regards, dan carpenter

Re: [PATCH] accel/qaic: silence some uninitialized variable warnings

2023-05-10 Thread Dan Carpenter
On Wed, May 10, 2023 at 08:57:03AM -0600, Jeffrey Hugo wrote: > On 5/3/2023 4:41 AM, Dan Carpenter wrote: > > Smatch complains that these are not initialized if get_cntl_version() > > fails but we still print them in the debug message. Not the end of > > the world, but tru

[PATCH] accel/qaic: silence some uninitialized variable warnings

2023-05-03 Thread Dan Carpenter
Smatch complains that these are not initialized if get_cntl_version() fails but we still print them in the debug message. Not the end of the world, but true enough. Let's just initialize them to a dummy value to make the checker happy. Signed-off-by: Dan Carpenter --- drivers/accel

Re: [PATCH] drm/imx/lcdc: fix a NULL vs IS_ERR() bug in probe

2023-05-03 Thread Dan Carpenter
On Sat, Apr 15, 2023 at 11:51:28PM +0200, Javier Martinez Canillas wrote: > Uwe Kleine-König writes: > > > On Wed, Mar 22, 2023 at 12:06:55PM +0300, Dan Carpenter wrote: > >> The devm_drm_dev_alloc() function returns error pointers. It never > >> returns NULL. F

[PATCH] drm/udl: delete dead code

2023-05-02 Thread Dan Carpenter
commit c5c354a3a472 ("drm/udl: Fix inconsistent urbs.count value during udl_free_urb_list()"). Reported-by: kernel test robot Signed-off-by: Dan Carpenter --- drivers/gpu/drm/udl/udl_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/udl/udl_main.

Re: [PATCH] video: fbdev: mmp: Fix deferred clk handling in mmphw_probe()

2023-04-18 Thread Dan Carpenter
On Sat, Apr 15, 2023 at 04:09:03PM +0300, Dan Carpenter wrote: > On Thu, Apr 13, 2023 at 09:33:17PM +0200, Christophe JAILLET wrote: > > When dev_err_probe() is called, 'ret' holds the value of the previous > > successful devm_request_irq() call. > > 'ret&#

Re: [PATCH] gpu: gma500: psb_drv: add missing unwind goto

2023-04-16 Thread Dan Carpenter
he result is the same (dead system). But these days we return -EPROBE_DEFER which is not a fatal error and we're supposed to recover from that without crashing. So on modern drivers changing the error path from a leak to a crash has a huge negative impact. regards, dan carpenter

Re: [PATCH 2/2] drm/panel-simple: allow LVDS format override

2023-04-16 Thread Dan Carpenter
/20230416/202304160359.4lhmfolu-...@intel.com/config) compiler: loongarch64-linux-gcc (GCC) 12.1.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Link: https://lore.kernel.org/r/202304160359.4lhmfolu-...@intel.com

Re: [PATCH] video: fbdev: mmp: Fix deferred clk handling in mmphw_probe()

2023-04-15 Thread Dan Carpenter
)") > Signed-off-by: Christophe JAILLET > --- Presumably you already wrote a Coccinelle script for this but I've added it to Smatch as well. regards, dan carpenter diff --git a/check_zero_to_err_ptr.c b/check_zero_to_err_ptr.c index 88ca0285948a..fa2a1f1603b2 100644 --- a/check_zero_to

Re: [PATCH 2/2] drm/nouveau/kms: Add INHERIT ioctl to nvkm/nvif for reading IOR state

2023-04-11 Thread Dan Carpenter
.org/0day-ci/archive/20230409/202304091929.sr0cfhln-...@intel.com/config) compiler: csky-linux-gcc (GCC) 12.1.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Link: https://lore.kernel.org/r/202304091929.sr0cfhln

Re: [PATCH] drm/vkms: add module parameter to set background color

2023-04-11 Thread Dan Carpenter
/202304082018.pxawwhse-...@intel.com/config) compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Link: https://lore.kernel.org/r/202304082018.pxawwhse-...@intel.com/ smatch warnings

[bug report] vga_switcheroo: set audio client id according to bound GPU id

2023-03-25 Thread Dan Carpenter
ops->gpu_bound(pdev, id); 385 } 386 mutex_unlock(&vgasr_mutex); 387 388 return register_client(pdev, ops, id | ID_BIT_AUDIO, vga_dev, 389 false, true); 390 } regards, dan carpenter

[PATCH] drm/panel: magnachip: Prevent error pointer dereference in probe

2023-03-22 Thread Dan Carpenter
Don't dereference "db->dsi_dev" when it is an error pointer. Fixes: 249a4f5e663c ("drm/panel: Add Magnachip D53E6EA8966 Panel Driver") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH] drm/imx/lcdc: fix a NULL vs IS_ERR() bug in probe

2023-03-22 Thread Dan Carpenter
The devm_drm_dev_alloc() function returns error pointers. It never returns NULL. Fix the check. Fixes: c87e859cdeb5 ("drm/imx/lcdc: Implement DRM driver for imx25") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[bug report] drm/vmwgfx: Do not drop the reference to the handle too soon

2023-03-22 Thread Dan Carpenter
that if "ret" is failure then "vbo" is NULL leading to an Oops. 699 return ret; 700 } regards, dan carpenter

Re: [PATCH v2 18/23] PM / QoS: Decouple request alloc from dev_pm_qos_mtx

2023-03-20 Thread Dan Carpenter
) 12.1.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Link: https://lore.kernel.org/r/202303211207.mucst3ck-...@intel.com/ smatch warnings: drivers/base/power/qos.c:947 dev_pm_qos_update_user_latency_tolerance() error

Re: [PATCH] fbdev: chipsfb: Fix error codes in chipsfb_pci_init()

2023-02-27 Thread Dan Carpenter
On Mon, Feb 27, 2023 at 11:13:19AM +0100, Thomas Zimmermann wrote: > Hi > > Am 27.02.23 um 11:07 schrieb Dan Carpenter: > > The error codes are not set on these error paths. > > > > Fixes: 145eed48de27 ("fbdev: Remove conflicting devices on PCI bus&qu

[PATCH v2] fbdev: chipsfb: Fix error codes in chipsfb_pci_init()

2023-02-27 Thread Dan Carpenter
The error codes are not set on these error paths. Fixes: 145eed48de27 ("fbdev: Remove conflicting devices on PCI bus") Signed-off-by: Dan Carpenter Reviewed-by: Thomas Zimmermann --- v2: I accidentally returned -EINVAL instead -ENODEV. Add Thomas's Reviewed-by tag. driv

[PATCH] drm/mediatek: dsi: fix error codes in mtk_dsi_host_transfer()

2023-02-27 Thread Dan Carpenter
ted to u32 and returned as positive values instead of negative error codes. Fixes: 81cc7e51c4f1 ("drm/mediatek: Allow commands to be sent during video mode") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/mediatek/mtk_dsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH] fbdev: chipsfb: Fix error codes in chipsfb_pci_init()

2023-02-27 Thread Dan Carpenter
The error codes are not set on these error paths. Fixes: 145eed48de27 ("fbdev: Remove conflicting devices on PCI bus") Signed-off-by: Dan Carpenter --- drivers/video/fbdev/chipsfb.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev

[PATCH] drm: rcar-du: Fix a NULL vs IS_ERR() bug

2023-02-27 Thread Dan Carpenter
The drmm_encoder_alloc() function returns error pointers. It never returns NULL. Fix the check accordingly. Fixes: 7a1adbd23990 ("drm: rcar-du: Use drmm_encoder_alloc() to manage encoder") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 4 ++-- 1 file

[bug report] drm/i915/mtl: Add hardware-level lock for steering

2023-02-08 Thread Dan Carpenter
l_engine_reset_bh(engine, NULL); ^^ Sleeping. 638 GEM_BUG_ON(rq->fence.error != -EIO); 639 640 engine_unlock_reset_tasklet(engine); preempt enabled again. 641 642 /* Check that we do not resubmit the held request */ regards, dan carpenter

Re: [PATCH v2 11/17] drm/display/dp_mst: Add helpers to query for payload allocation errors

2023-02-02 Thread Dan Carpenter
, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/display/drm_dp_mst_topology.c:3316 drm_dp_add_payload_part1() warn: missing error code 'ret' vim +/ret +3316 drivers/gpu/drm/display/drm_dp_mst_

[PATCH] drm/simpledrm: Fix an NULL vs IS_ERR() bug

2023-01-26 Thread Dan Carpenter
The devm_memremap() function doesn't return NULL, it returns error pointers. Fixes: 9a10c7e6519b ("drm/simpledrm: Add support for system memory framebuffers") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/tiny/simpledrm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[bug report] habanalabs: add debugfs support

2023-01-17 Thread Dan Carpenter
^ so it can't take a mutex or it leads to a sleeping in atomic bug. These can be detected at runtime by enabling CONFIG_DEBUG_ATOMIC_SLEEP. regards, dan carpenter

[PATCH] drm/vmwgfx: Fix uninitialized return variables

2023-01-13 Thread Dan Carpenter
This code accidentally returns the wrong variable (which is uninitialized). It should return ret. Fixes: a309c7194e8a ("drm/vmwgfx: Remove rcu locks from user resources") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx

Re: [bug report] habanalabs: Timestamps buffers registration

2023-01-10 Thread Dan Carpenter
is can't actually overflow because it's checked in the caller. Perhaps the careful way to write this is to change size to size_t as you suggest which fixes the issue for 64bit systems and use size_mul() so it doesn't overflow on 32bit systems either. size = size_mul(num_elements, sizeof(u64)); But it doesn't really matter either way because num_elements is capped in the caller. regards, dan carpenter

[bug report] habanalabs: Timestamps buffers registration

2023-01-06 Thread Dan Carpenter
06 free_mem: 2207 kfree(ts_buff); 2208 return -ENOMEM; 2209 } regards, dan carpenter

Re: [PATCH] drm/msm: another fix for the headless Adreno GPU

2023-01-04 Thread Dan Carpenter
applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/msm/msm_atomic.c:194 msm_atomic_commit_tail() error: uninitialized symbol 'async'. vim +/async +194 drivers/gpu/drm/msm/msm_atomic.c d4d2c60497cfc5 Rob Clark2019-

Re: [PATCH 3/5] drm/rockchip: vop2: use symmetric function pair vop2_{create,destroy}_crtcs

2023-01-03 Thread Dan Carpenter
: Dan Carpenter New smatch warnings: drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:2330 vop2_create_crtcs() error: uninitialized symbol 'possible_crtcs'. vim +/possible_crtcs +2330 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c fb83276e59f2d6 Michael Riesch 2022-11-30 2249

[drm-misc:drm-misc-next 25/26] drivers/gpu/drm/bridge/panel.c:367 devm_drm_panel_bridge_add_typed() error: 'bridge' dereferencing possible ERR_PTR()

2022-12-29 Thread Dan Carpenter
) 12.1.0 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/bridge/panel.c:367 devm_drm_panel_bridge_add_typed() error: 'bridge' dereferencing possible ERR_PTR() vim +/bridge +367 d

Re: [PATCH v6] drm: Optimise for continuous memory allocation

2022-12-22 Thread Dan Carpenter
test robot | Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/drm_buddy.c:501 find_continuous_blocks() error: uninitialized symbol 'block'. vim +/block +501 drivers/gpu/drm/drm_buddy.c 8a257b57bc11a2 xinhui pan 2022-12-18 472 static struct drm_buddy_block * 8a257b57bc11a2

Re: [PATCH 1/4] drm/msm/adreno: Fix null ptr access in adreno_gpu_cleanup()

2022-12-05 Thread Dan Carpenter
get_pid(task_pid(task)); 839 } 840 841 if (IS_ERR_OR_NULL(aspace)) ^^ [QUESTION #3] This check seems reversed. It should be if *NOT* is error or null. 842 aspace = msm_gem_address_space_get(gpu->aspace); 843 844 return aspace; 845 } regards, dan carpenter

[bug report] drm: rcar-du: Add RZ/G2L DSI driver

2022-11-18 Thread Dan Carpenter
vich1ppsetr |= VICH1PPSETR_TXESYNC_PULSE; ^^^ Uninitialized. 373 374 rzg2l_mipi_dsi_link_write(dsi, VICH1PPSETR, vich1ppsetr); regards, dan carpenter

[PATCH v2] drm/msm/hdmi: remove unnecessary NULL check

2022-11-18 Thread Dan Carpenter
33ec ("drm/msm/hdmi: move resource allocation to probe function") Signed-off-by: Dan Carpenter --- v2: Add a Fixes tag. Re-work the commit message. drivers/gpu/drm/msm/hdmi/hdmi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/dr

[bug report] Merge branch 'for-linux-next' of git://anongit.freedesktop.org/drm/drm-misc

2022-11-18 Thread Dan Carpenter
)) { 355 mutex_unlock(&vc4_hdmi->mutex); 356 return 0; 357 } 358 359 scrambling_needed = vc4_hdmi_mode_needs_scrambling(&vc4_hdmi->saved_adjusted_mode, 360 vc4_hdmi->output_bpc, regards, dan carpenter

[PATCH] drm/nouveau/gr/gv100-: unlock on error in gf100_gr_chan_new()

2022-11-15 Thread Dan Carpenter
Drop the "gr->fecs.mutex" lock before returning on this error path. Fixes: ca081fff6ecc ("drm/nouveau/gr/gf100-: generate golden context during first object alloc") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 1 + 1 file changed, 1 i

[PATCH] drm/nouveau/fifo: small cleanup in nvkm_chan_cctx_get()

2022-11-15 Thread Dan Carpenter
The "&chan->cgrp->mutex" and "&cgrp->mutex" variables refer to the same thing. Use "&cgrp->mutex" consistently. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c | 2 +- 1 file changed, 1 insertion(+), 1

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