advantage to making this const?
regards,
dan carpenter
Thanks!
Acked-by: Dan Carpenter
regards,
dan carpenter
/20240310/202403101225.7ahejhzj-...@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot
| Reported-by: Dan Carpenter
| Closes
d yet and it would need a bit of adjusting for this
use case but it's basically what you want.
regards,
dan carpenter
efore that
> close parenthesis ')'".
>
> Signed-off-by: Kyoji Ogasawara
This breaks the build. You could do a search for it.
https://lore.kernel.org/all/?q=define_fbtft_write_reg
regards,
dan carpenter
On Mon, Feb 19, 2024 at 06:59:02PM +0100, Christophe JAILLET wrote:
> Le 19/02/2024 à 09:37, Dan Carpenter a écrit :
> > On Sun, Feb 18, 2024 at 06:46:44PM +0100, Christophe JAILLET wrote:
> > > If 'list_limit' is set to a very high value, 'lsize' computati
t high
enough to lead to an integer overflow then you kind of deserve what
you get.
This patch is nice for kernel hardening and making the code easier to
read/audit but the real world security impact is negligible.
regards,
dan carpenter
| Reported-by: Dan Carpenter
| Closes: https://lore.kernel.org/r/202402180310.gmdixajx-...@intel.com/
New smatch warnings:
drivers/gpu/drm/i915/display/intel_color.c:3867 intel_plane_tf_pipeline_init()
error: 'colorop' dereferencing possible ERR_PTR()
vim +/colorop +3867 drivers/gp
If gf100_bar_new_() fails then "bar" is not initialized.
Fixes: 5bf0257136a2 ("drm/nouveau/mmu/r535: initial support")
Signed-off-by: Dan Carpenter
---
It looks like this was intended to handle a failure from the "rm" func
but "rm" can't actually fa
The resource is inclusive of the ->start and ->end addresses so this
calculation is not correct. It should be "res->end - res->start + 1".
Use the resource_size() to do the calculation.
Fixes: 90393c9b5408 ("drm/imx/dcss: request memory region")
Signed-off-by:
These ANDs should be ORs or it will lead to a NULL dereference.
Fixes: fb5a3d037082 ("drm/amd/display: Add NULL test for 'timing generator' in
'dcn21_set_pipe()'")
Fixes: 886571d217d7 ("drm/amd/display: Fix 'panel_cntl' could be null in
'
>input_bus_flags;
81 else if (bridge_state)
This check for NULL is too late. Hopefully it can it be removed?
82 bus_flags = bridge_state->input_bus_cfg.flags;
83
regards,
dan carpenter
The pvr_vm_context_lookup() function returns NULL on error (not error
pointers). Update the check accordingly.
Fixes: d2d79d29bb98 ("drm/imagination: Implement context creation/destruction
ioctls")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/imagination/pvr_context.c | 4 ++
> > > These are bool, so it is just a bitwise or.
> >
> > Should be a logical or, really. And || in code.
>
> Not really, bitwise is fine for bool (especially for 'or')
> and generates better code.
For | vs || the type doesn't make a difference... It makes a difference
for AND. "0x1 & 0x10" vs "0x1 && 0x10".
regards,
dan carpenter
.
Fixes: e0f74ed4634d ("i915/gvt: Separate the MMIO tracking table from GVT-g")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/i915/gvt/handlers.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/handlers.c
b/drivers/gpu/drm/i915/gvt/handler
close_fd(fd);
825 if (WARN_ON_ONCE(IS_ERR(dmabuf)))
826 return PTR_ERR(dmabuf);
827 mem->dmabuf = dmabuf;
828 }
829
830 return 0;
831 }
regards,
dan carpenter
Let's CC Felix on this one because he might know the answer.
All day long I spend looking at code like this:
net/core/dev.c:724 dev_fill_forward_path() info: returning a literal zero is
cleaner
net/core/dev.c:732 dev_fill_forward_path() info: returning a literal zero is
cleaner
net/core/dev.c
On Tue, Jan 23, 2024 at 12:04:23AM +0100, Danilo Krummrich wrote:
> On 1/16/24 13:31, Dan Carpenter wrote:
> > On Tue, Jan 16, 2024 at 11:16:09AM +, Colin Ian King wrote:
> > > The variable ret is being assigned a value but it isn't being
> > > read afterwards.
st(struct nvif_device *device, u64 engine)
> {
> u64 runm = 0;
> - int ret, i;
> + int i;
>
> - if ((ret = nvif_fifo_runlists(device)))
> + if (nvif_fifo_runlists(device))
> return runm;
Could we return a literal zero here? Otherwise, I'm surprised this
doesn't trigger a static checker warning.
regards,
dan carpenter
This code was shuffled around but the return wasn't updated. It should
return "ret" instead of "ctrl".
Fixes: 4ae3a20102b2 ("nouveau/gsp: don't free ctrl messages on errors")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/nouveau/nvkm/engine/disp/r5
The aca_bank_hwip_is_matched() function is type bool. This error path
return -EINVAL which is cast to true, but it should return false
instead.
Fixes: 22a4fa4709e3 ("drm/amdgpu: implement RAS ACA driver framework")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/amd/amdgpu/amdgpu
628 ret = ((int (*)(struct lcd_device *))match->data)(lcdev);
629 if (ret) {
630 dev_err(&spi->dev, "Couldn't initialize panel\n");
631 return ret;
632 }
633
634 dev_info(&spi->dev, "Panel probed\n");
635
636 return 0;
637 }
regards,
dan carpenter
The GUC_HXG_MSG_0_ORIGIN definition should be unsigned. Currently it is
defined as INT_MIN. This doesn't cause a problem currently but it's
still worth cleaning up.
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/xe/abi/guc_messages_abi.h | 2 +-
1 file changed, 1 insertion(+),
-denominator :
denominator);
67
68 uint16_t remainder;
69
regards,
dan carpenter
This error path should clean up before returning.
Smatch detected this bug:
drivers/gpu/drm/xe/xe_device.c:487 xe_device_probe() warn: missing unwind
goto?
Fixes: 4cb12b71923b ("drm/xe/xe2: Determine bios enablement for flat ccs on
igfx")
Signed-off-by: Dan Carpenter
---
Speeking
/* drop reference from allocate - handle holds it now */
2261 drm_gem_object_put(&bo->ttm.base);
2262 if (!err)
2263 args->handle = handle;
2264 return err;
2265 }
regards,
dan carpenter
otential shift wrapping.
1917
1918 if (args->flags & DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM) {
1919 if (XE_IOCTL_DBG(xe, !(bo_flags &
XE_BO_CREATE_VRAM_MASK)))
1920 return -EINVAL;
1921
1922 bo_flags |= XE_BO_NEEDS_CPU_ACCESS;
1923 }
1924
regards,
dan carpenter
Check if "bo" is an error pointer before calling xe_bo_lock() on it.
Fixes: d6abc18d6693 ("drm/xe/xe2: Modify xe_bo_test for system memory")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/xe/tests/xe_bo.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --g
Drop the "&vm->lock" before returning.
Fixes: 24f947d58fe5 ("drm/xe: Use DRM GPUVM helpers for external- and evicted
objects")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/xe/xe_vm.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/d
ation details out.
>
> That doesn't answer my question.
>
> Without seeing the actual Coccinelle report, I'll assume that it didn't
> actually call for this change.
This isn't one of the Coccinelle scripts which ship with the kernel,
it's something that Markus wrote himself.
regards,
dan carpenter
168 }
169 }
170
171 retry:
172 if (!xe_vm_in_lr_mode(vm) && xe_vm_userptr_check_repin(vm)) {
173 err = down_write_killable(&vm->lock);
174 write_locked = true;
175 } else {
regards,
dan carpenter
On Thu, Jan 04, 2024 at 10:41:50AM +1000, Dave Airlie wrote:
> On Thu, 4 Jan 2024 at 00:47, Dan Carpenter wrote:
> >
> > Hi Dave,
> >
> > kernel test robot noticed the following build warnings:
> >
> > https://git-scm.com/docs/git-format-patch#_base_tree_
#x27;t have to write ", false" so much.
3) You could mark the _interruptible version as must check and the other
version could be a void function.
4) Smatch could parse it automatically. I can write some custom code
to parse the existing function but it's a small hassle for me.
regards,
dan carpenter
test robot
| Reported-by: Dan Carpenter
| Closes: https://lore.kernel.org/r/202312271917.55xudmdc-...@intel.com/
New smatch warnings:
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:659 r535_gsp_rpc_rm_ctrl_push()
warn: passing zero to 'PTR_ERR'
drivers/gpu/drm/nouveau/nvkm/engine/d
Thanks so much.
Reviewed-by: Dan Carpenter
regards,
dan carpenter
), kindly add following tags
| Reported-by: kernel test robot
| Reported-by: Dan Carpenter
| Closes: https://lore.kernel.org/r/202312070214.eyi9t4eq-...@intel.com/
smatch warnings:
drivers/gpu/drm/panel/panel-synaptics-r63353.c:132 r63353_panel_activate()
warn: missing unwind goto?
vim +132 drivers
can never be zero, but even if
it were, then I feel like this would still be the best way to write it.
Fixes: 914437992876 ("drm/bridge: nxp-ptn3460: fix i2c_master_send() error
checking")
Signed-off-by: Dan Carpenter
---
This is not really a bug fix but I added a Fixes tag because
This code dereferences "page->pvr_dev" and then checked for NULL on the
next line. Re-order it to avoid a potential NULL pointer dereference.
Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/imaginatio
nt-i-is-stupid/
https://staticthinking.wordpress.com/2023/07/25/wsign-compare-is-garbage/
You didn't ask for rants... No one ever asks for rants...
205 WRITE_ONCE(mips_data->pt[pfn], 0);
206
207 pvr_mmu_flush_request_all(pvr_dev);
208 WARN_ON(pvr_mmu_flush_exec(pvr_dev, true));
209
210 return err;
211 }
regards,
dan carpenter
ce.
The pvr_vm_context_release() function has several WARN() functions that
trigger if not everything is set up. It's complicated to review. So I
kind of always think that people should manually kfree() things in their
allocation functions and then do a kref_init() at the end.
635
636 return ERR_PTR(err);
637 }
regards,
dan carpenter
C_CLRMSK);
218 pvr_cr_write32(pvr_dev, ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC,
219ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC_MASKFULL &
220
ROGUE_CR_MTS_BGCTX_THREAD1_DM_ASSOC_DM_ASSOC_CLRMSK);
221
222 /* Extra Idle checks. */
223 err = pvr_cr_poll_reg32(pvr_dev, ROGUE_CR_BIF_STATUS_MMU, 0,
regards,
dan carpenter
The platform_get_irq() function returns negative error codes. It never
returns zero. Fix the check accordingly.
Fixes: 82c2a5751227 ("drm/msm/dp: tie dp_display_irq_handler() with dp driver")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/msm/dp/dp_display.c | 4 ++--
1 file
On Tue, Dec 05, 2023 at 03:04:49PM +0100, Robert Foss wrote:
> On Tue, Dec 5, 2023, 15:01 Dan Carpenter wrote:
>
> > On Tue, Dec 05, 2023 at 02:48:26PM +0100, Robert Foss wrote:
> > > On Mon, 4 Dec 2023 15:29:00 +0300, Dan Carpenter wrote:
> > > > The i2c_ma
On Tue, Dec 05, 2023 at 02:48:26PM +0100, Robert Foss wrote:
> On Mon, 4 Dec 2023 15:29:00 +0300, Dan Carpenter wrote:
> > The i2c_master_send/recv() functions return negative error codes or the
> > number of bytes that were able to be sent/received. This code has
> > two p
rday for some
> unrelated reason, so it should be fixed in next-20231205 onward.
Sorry, that's a bummer that these patches were reverted. :( The whole
episode was a bit unfortunate...
Qualcom has been working on those patches for a year. They must not be
using kunit testing as part of their QC... It's some kind of
communication failure on our part.
Hopefully we can get this all sorted out and re-apply the patches soon.
regards,
dan carpenter
On Mon, Dec 04, 2023 at 02:53:05PM +0100, Neil Armstrong wrote:
> On 04/12/2023 13:29, Dan Carpenter wrote:
> > The i2c_master_send/recv() functions return negative error codes or the
> > number of bytes that were able to be sent/received. This code has
> > two problems. 1)
ery)) {
543 spin_unlock(&kiq->ring_lock);
544 return 0;
545 }
546
547 if (kiq_ring->sched.ready && !adev->job_hang)
548 r = amdgpu_ring_test_helper(kiq_ring);
549 spin_unlock(&kiq->ring_lock);
regards,
dan carpenter
send/receive then we should return a negative
error code but this code returns success.
Fixes: a9fe713d7d45 ("drm/bridge: Add PTN3460 bridge driver")
Cc: sta...@vger.kernel.org
Signed-off-by: Dan Carpenter
---
This is from static analysis and code review. It's always a conce
0). At that point we know that all the elements thus
far are initialized so we don't need to have NULL checks.
Fixes: 927f3e0253c1 ("drm/imagination: Implement MIPS firmware processor and
MMU support")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/imagination/pvr_vm_mips.c |
&
~ROGUE_CR_MTS_SCHEDULE_DM_CLRMSK);
^^
PVR_FWIF_DM_GP is zero.
278
279 out_unlock:
280 mutex_unlock(&pvr_ccb->lock);
281 }
regards,
dan carpenter
The pvr_build_firmware_filename() function returns NULL on error. It
doesn't return error pointers.
Fixes: f99f5f3ea7ef ("drm/imagination: Add GPU ID parsing and firmware loading")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/imagination/pvr_device.c | 4 ++--
1 file change
There is a cut and paste error so this code returns the wrong variable.
Fixes: 1f88f017e649 ("drm/imagination: Get GPU resources")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/imagination/pvr_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drive
On Wed, Nov 29, 2023 at 11:12:29AM +, Flavio Suligoi wrote:
> Hi Dan,
>
> Can I add the "Reported-by" tag, with your name, in my 2nd vers of
> the commit to fix this bug?
Yeah. Thanks! If the bug report is sent to a public mailing list then
there is no need to ask.
regards,
dan carpenter
92 if (ret)
293 pdata->default_brightness = pdata->max_brightness;
294 if (pdata->default_brightness > pdata->max_brightness) {
295 dev_err(chip->dev,
296 "default brightness exceeds max brightness\n");
297 pdata->default_brightness = pdata->max_brightness;
298 }
299
300 /*
regards,
dan carpenter
This unlock doesn't belong here and it leads to a double unlock in
the caller, r535_gsp_rpc_push().
Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 4 +---
1 file chang
On Thu, Nov 16, 2023 at 01:05:52PM -0800, Abhinav Kumar wrote:
>
>
> On 11/1/2023 12:23 PM, Abhinav Kumar wrote:
> >
> >
> > On 10/13/2023 1:25 AM, Dan Carpenter wrote:
> > > This NULL check was required when it was added, but we shuffled the code
now I know
to look for WARN(), lockdep, and KASAN. What other bugs formats do we
have? Probably someone like the syzbot devs have already has written a
script like this?
regards,
dan carpenter
t for booting GSP-RM")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c
index e31f9641114b..f8
The if we hit the "continue" statement on the first iteration through
the loop then "handle_mux" needs to be set to NULL so we continue
looping.
Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM")
Signed-off-by: Dan Carpenter
---
drivers/g
://lore.kernel.org/all/CA+G9fYuA643RHHpPnz9Ww7rr3zV5a0y=7_uFcybBSL=qp_s...@mail.gmail.com/
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/drm_rect.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
index 85c79a38c13a
Let me add Richard to the CC list. See lore for more details.
https://lore.kernel.org/all/CA+G9fYuA643RHHpPnz9Ww7rr3zV5a0y=7_uFcybBSL=qp_s...@mail.gmail.com/
On Tue, Oct 31, 2023 at 09:57:48PM +0530, Naresh Kamboju wrote:
> On Mon, 30 Oct 2023 at 14:33, Dan Carpenter wrote:
> >
&g
onal warning finished\n" message at the end.
I haven't actually tested this patch... Daniel, do you have a
list of intentional stack traces we could annotate?
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/tests/drm_rect_test.c | 2 ++
include/kunit/test.h | 3 +++
On Fri, Oct 20, 2023 at 05:11:24PM +0300, Dan Carpenter wrote:
> On Fri, Oct 20, 2023 at 02:55:37PM +0300, Ville Syrjälä wrote:
> > On Fri, Oct 20, 2023 at 02:39:04PM +0300, Dan Carpenter wrote:
> > > On Wed, Oct 18, 2023 at 05:17:42PM +0300, Dan Carpenter wrote:
> > > &
I've re-written the error handling but the bug is that if init_imstt()
fails we need to call iounmap(par->cmap_regs).
Fixes: c75f5a550610 ("fbdev: imsttfb: Fix use after free bug in imsttfb_probe")
Signed-off-by: Dan Carpenter
---
drivers/video/fb
The init_imstt() function calls framebuffer_release() on error and then
the probe() function calls it again. It should only be done in probe.
Fixes: 518ecb6a209f ("fbdev: imsttfb: Fix error path of imsttfb_probe()")
Signed-off-by: Dan Carpenter
---
drivers/video/fbdev/imsttfb.c | 6
> GPU id")
> Signed-off-by: Su Hui
> ---
> v2:
> - add check of VGA_SWITCHEROO_UNKNOWN_ID(Dan's suggestion).
>
> By the way, all functions of 'get_client_id' will never return error code
> or VGA_SWITCHEROO_UNKNOWN_ID,should we remove this check or
On Thu, Oct 26, 2023 at 04:46:29PM +0800, Su Hui wrote:
> On 2023/10/26 12:44, Dan Carpenter wrote:
> > On Thu, Oct 26, 2023 at 10:10:57AM +0800, Su Hui wrote:
> > > 'id' is enum type like unsigned int, so it will never be less than zero.
> > >
> >
ck for. It honestly might be good
to check for both...
if ((int)id < 0 || id == VGA_SWITCHEROO_UNKNOWN_ID) {
mutex_unlock(&vgasr_mutex);
return -EINVAL;
}
regards,
dan carpenter
On Fri, Oct 20, 2023 at 02:55:37PM +0300, Ville Syrjälä wrote:
> On Fri, Oct 20, 2023 at 02:39:04PM +0300, Dan Carpenter wrote:
> > On Wed, Oct 18, 2023 at 05:17:42PM +0300, Dan Carpenter wrote:
> > > drivers/gpu/drm/drm_rect.c
> > >134 static int drm_calc_scale(int
_format_info(DRM_FORMAT_R8);
931 if (!fi)
regards,
dan carpenter
On Wed, Oct 18, 2023 at 05:17:42PM +0300, Dan Carpenter wrote:
> drivers/gpu/drm/drm_rect.c
>134 static int drm_calc_scale(int src, int dst)
>135 {
>136 int scale = 0;
>137
>138 if (WARN_ON(
0
[ 1297.768452] bfe0: 0013
[ 1297.769652] ---[ end trace ]---
regards,
dan carpenter
If I had to guess, I'd say it's an issue in the vc4_mock driver. It's
crashing somewhere in Subtest: drm_vc4_test_pv_muxing.
regards,
dan carpenter
On Fri, Oct 13, 2023 at 11:44:32PM +0530, Naresh Kamboju wrote:
> Following kasan bug was noticed on arm64 bcm2711-rpi-4-b devi
Return negative -ENXIO instead of positive ENXIO.
Signed-off-by: Dan Carpenter
---
No fixes tag because the caller doesn't check for errors.
drivers/video/fbdev/omap/omapfb_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/omap/omapfb_main
On Fri, Oct 13, 2023 at 10:01:49AM +0200, Uwe Kleine-König wrote:
> Hello,
>
> On Fri, Oct 13, 2023 at 10:17:08AM +0300, Dan Carpenter wrote:
> > This NULL check was required when it was added, but we shuffled the code
> > around in commit 1f50db2f3e1e ("drm/msm/mdp5
ine 782)
Fixes: 1f50db2f3e1e ("drm/msm/mdp5: move resource allocation to the _probe
function"
Signed-off-by: Dan Carpenter
---
v2: Added a Fixes tag. It's not really a bug fix and so adding the
fixes tag is slightly unfair but it should prevent this patch from
accidentally
/mdp5_kms.c:847 mdp5_init() warn:
variable dereferenced before check 'mdp5_kms' (see line 782)
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
b
on this config...
122 priv->mapping = mapping;
123 }
124
125 return drm_iommu_attach_device(drm, dev, dma_priv);
126 }
regards,
dan carpenter
40
241 iter.hdr->bomap.valid = 1;
242
243 dump_header: panfrost_core_dump_header(&iter,
PANFROSTDUMP_BUF_BO, iter.data +
regards,
dan carpenter
reated as
success. Add a cast to fix this.
Fixes: 38f993b7c59e ("drm/rockchip: Do not use DMA mapping API if attached to
IOMMU domain")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
On Mon, Oct 02, 2023 at 10:16:24AM -0700, T.J. Mercier wrote:
> On Mon, Oct 2, 2023 at 12:04 AM Dan Carpenter
> wrote:
> >
> > The buffer->pages[] has "buffer->pagecount" elements so this > comparison
> > has to be changed to >= to avoid reading beyo
helper logic into the cma_heap
implementation")
Signed-off-by: Dan Carpenter
---
drivers/dma-buf/heaps/cma_heap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c
index ee899f8e6721..bea7e574f916 100644
--- a/dri
ERR_PTR(-EOVERFLOW);
No need for an unlikely() because check_mul_overflow() already has one
inside. I feel like -ENOMEM is more traditional but I doubt anyone/userspace
cares.
> +
> + return memdup_user(src, nbytes);
> +}
regards,
dan carpenter
On Sat, Sep 16, 2023 at 05:24:04PM +0300, Dan Carpenter wrote:
> On Sat, Sep 16, 2023 at 01:41:43AM +0200, Danilo Krummrich wrote:
> > Hi Dan,
> >
> > On 9/15/23 14:59, Dan Carpenter wrote:
> > > The u_memcpya() function is supposed to return error pointers on
>
On Sat, Sep 16, 2023 at 01:41:43AM +0200, Danilo Krummrich wrote:
> Hi Dan,
>
> On 9/15/23 14:59, Dan Carpenter wrote:
> > The u_memcpya() function is supposed to return error pointers on
> > error. Returning NULL will lead to an Oops.
> >
> > Fixes: 6813
The irq_of_parse_and_map() function returns zero on error. It
never returns negative error codes. Fix the check.
Fixes: a689554ba6ed ("drm/msm: Initial add DSI connector support")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/msm/dsi/dsi_host.c | 7 +++
1 file changed, 3
The u_memcpya() function is supposed to return error pointers on
error. Returning NULL will lead to an Oops.
Fixes: 68132cc6d1bc ("nouveau/u_memcpya: use vmemdup_user")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/nouveau/nouveau_drv.h | 2 +-
1 file changed, 1 insertion(+),
about this code in v3
but it looks good now. I'm not a DRM dev so I'm not sure my review
counts for much. You should always just assume that if I'm quiet
then I'm happy. :)
regards,
dan carpenter
Move the check for "if (IS_ERR(obj))" in front of the call to
i915_gem_object_set_cache_coherency() which dereferences "obj".
Otherwise it will lead to a crash.
Fixes: 43aa755eae2c ("drm/i915/mtl: Update cache coherency setting for context
structure")
Signed-off-b
tags
| Reported-by: kernel test robot
| Reported-by: Dan Carpenter
| Closes: https://lore.kernel.org/r/202309070814.jygjojzy-...@intel.com/
smatch warnings:
drivers/gpu/drm/drm_gem_shmem_helper.c:733 drm_gem_shmem_fault() error: we
previously assumed 'shmem->pages' could be null
| Reported-by: kernel test robot
| Reported-by: Dan Carpenter
| Closes: https://lore.kernel.org/r/202309060644.uwp5zw4i-...@intel.com/
smatch warnings:
drivers/gpu/drm/i915/display/intel_dp.c:3779 intel_dp_vsc_sdp_pack() warn: was
&& intended here instead of ||?
vim +3779 drivers/gpu/drm/i915
with u64 values but on 32bit
systems the kmalloc() function will truncate the sizes to 32 bits. So
I calculated "total = in_trans->size + offset_in_page(xfer_start_addr);"
and returned -EINVAL if it were >= SIZE_MAX. This will not affect 64bit
systems.
Fixes: 129776ac2e38 ("accel/qa
), kindly add following tags
| Reported-by: kernel test robot
| Reported-by: Dan Carpenter
| Closes: https://lore.kernel.org/r/202308090559.rmlh2dl6-...@intel.com/
smatch warnings:
drivers/gpu/drm/display/drm_simple_bridge.c:41 drm_simple_bridge_register()
warn: possible memory leak of 'adev&
On Mon, Aug 07, 2023 at 05:09:34PM +0300, Dan Carpenter wrote:
> + remaining = in_trans->size - resources->xferred_dma_size;
> + total = in_trans->size + offset_in_page(xfer_start_addr);
> + if (total >= SIZE_MAX)
Btw, I wrote it >= instead of > to silence s
On Mon, Aug 07, 2023 at 05:09:34PM +0300, Dan Carpenter wrote:
> The encode_dma() function has some validation on in_trans->size but it's
> not complete and it would be more clear to move those checks to
> find_and_map_user_pages().
>
> The encode_dma() had two checks:
not overflow.
My other concern was that we are dealing with u64 values but on 32bit
systems the kmalloc() function will truncate the sizes to 32 bits. So
I calculated "total = in_trans->size + offset_in_page(xfer_start_addr);"
and returned -EINVAL if it were >= SIZE_MAX. This w
add following tags
| Reported-by: kernel test robot
| Reported-by: Dan Carpenter
| Closes: https://lore.kernel.org/r/202308041725.npwswh0l-...@intel.com/
smatch warnings:
drivers/base/power/qos.c:973 dev_pm_qos_update_user_latency_tolerance() warn:
possible memory leak of 'req'
vim
,
> panel);
> + if (ret)
> + goto free_ddc;
This *looks* like we are returning an error but we aren't. I think we
should be. If not then we need to have a discussion about that and
add some comments.
regards,
dan carpenter
> + }
> +
>
On Wed, Jul 26, 2023 at 09:21:50AM +0800, Su Hui wrote:
> On 2023/7/25 13:51, Dan Carpenter wrote:
> > The reason why the first five attempts had bugs is because we are
> > trying to write it in the most complicated way possible, shifting by
> > logical not what?
> Wond
The reason why the first five attempts had bugs is because we are
trying to write it in the most complicated way possible, shifting by
logical not what?
regards,
dan carpenter
diff --git a/drivers/gpu/drm/i915/display/intel_tv.c
b/drivers/gpu/drm/i915/display/intel_tv.c
index 36b479b46b60
101 - 200 of 1078 matches
Mail list logo