et(dev);
> +
> + return 0;
> +
> +err:
> + kfree(ldev);
I'm sorry, in the earlier version I told you to add this kfree() but
this is devm_ allocated so the kfree() is wrong and will lead to a
double free. My bad. That's on me.
> + drm_err(dev, "failed to initialize drm driver: %d\n", ret);
> + return ret;
> +}
regards,
dan carpenter
On Tue, Jul 27, 2021 at 01:57:53PM -0700, Kees Cook wrote:
> In preparation for FORTIFY_SOURCE performing compile-time and run-time
> field bounds checking for memcpy(), memmove(), and memset(), avoid
> intentionally writing across neighboring fields.
>
> The it_present member of struct ieee80211_
: Add support for KeemBay Display")
> Fixes: 98521f4d4b4c ("drm/kmb: Mipi DSI part of the display driver")
> Cc: Dan Carpenter
> Signed-off-by: Anitha Chrisanthus
> ---
> drivers/gpu/drm/kmb/kmb_drv.c | 9 ++---
> drivers/gpu/drm/kmb/kmb_dsi.c | 9 +--
ps://lore.kernel.org/lkml/fbddb15a-6e46-3f21-23ba-b18f66e34...@suse.com/)
In the kernel we don't care about portability so much. Use the = { }
GCC extension. If the first member of the struct is a pointer then
Sparse will complain about = { 0 }.
I had a patch to make checkpatch.pl complain about = { 0 }; but my
system died and I haven't transfered my postponed messages to the new
system...
regards,
dan carpenter
On Thu, Jul 29, 2021 at 07:56:27AM +0200, Greg Kroah-Hartman wrote:
> On Wed, Jul 28, 2021 at 11:37:30PM +0200, David Sterba wrote:
> > On Wed, Jul 28, 2021 at 02:37:20PM -0700, Bart Van Assche wrote:
> > > On 7/28/21 2:14 AM, Dan Carpenter wrote:
> > > > On Wed, Ju
On Wed, Jul 28, 2021 at 04:33:18PM -0700, Kees Cook wrote:
>
> Ah-ha, got it:
>
Thanks, Kees! Nice!
regards,
dan carpenter
-1ubuntu1~20.04) 10.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
Reported-by: Dan Carpenter
smatch warnings:
samples/vfio-mdev/mbochs.c:566 mbochs_probe() error: we previously assumed
'mdev_state' could be null (see line 524)
samples
ret = ttm_bo_vm_fault_reserved(vmf, prot, num_prefault, 1);
481 if (ret == VM_FAULT_RETRY && !(vmf->flags &
FAULT_FLAG_RETRY_NOWAIT))
482 return ret;
483
484 out_unlock:
485 dma_resv_unlock(bo->base.resv);
486
487 return ret;
488 }
regards,
dan carpenter
Huh... Vmware is blocking email to Thomas?
"Recipient is not authorized to accept external mail"
This seems like potentially a serious bug and I don't know how to report
it.
regards,
dan carpenter
On Thu, Jul 29, 2021 at 05:39:45PM +0300, Dan Carpenter wrote:
> Hello Thomas H
;t initialize holes.
regards,
dan carpenter
If nouveau_get_backlight_name() fails then this should return -ENOMEM
but currently it returns success.
Fixes: db1a0ae21461 ("drm/nouveau/bl: Assign different names to interfaces")
Signed-off-by: Dan Carpenter
---
This is from static analysis. In the original commit db1a0ae21461
(&q
If the kmemdup() fails then this should return a negative error code
but it currently returns success
Fixes: b4a7db71ea06 ("drm/amdgpu: add per device user friendly xgmi events for
vega20")
Signed-off-by: Dan Carpenter
---
v2: I sent this patch in Feb but I accidentally added an unre
codes and make everything consistent.
Fixes: c5d71cb31723 ("drm/i915/gvt: Move vGPU type related code into gvt file")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/i915/gvt/gvt.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/gvt.
This code should propagate the error from intel_overlay_pin_fb()
but currently it returns success.
Fixes: 1b321026e213 ("drm/i915: Pass ww ctx to intel_pin_to_display_plane")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/i915/display/intel_overlay.c | 4 +++-
1 file changed, 3
true;
> > return soc_dev;
> >
> > out3:
> > @@ -246,6 +248,9 @@ const struct soc_device_attribute *soc_device_match(
> > if (!matches)
> > return NULL;
> >
> > + if (!soc_dev_attr_init_done && !ea
me.
Reported-by: kernel test robot
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/vc4/vc4_drv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
index a7500716cf3f..5dceadc61600 100644
--- a/drivers/gpu/drm/vc4/
turn dev_err_probe(dev, PTR_ERR(*gpiop), "Failed to request
%s GPIO\n", name);
> +
> fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' GPIO\n",
> __func__, name);
>
> - return ret;
> + return 0;
> }
regards,
dan carpenter
On Thu, Apr 29, 2021 at 05:42:44PM +0300, Dan Carpenter wrote:
> On Wed, Apr 28, 2021 at 04:04:14PM +0300, Andy Shevchenko wrote:
> > @@ -75,20 +75,16 @@ static int fbtft_request_one_gpio(struct fbtft_par *par,
> > struct gpio_desc **gpiop)
> &
Check whether the kcalloc() fails and return -ENOMEM if it does.
Fixes: eeba0b9046fc ("drm/amdgpu: create amdgpu_vkms (v4)")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amd
mapping,
> pgoff,
>
> FGP_ACCESSED);
> - if (IS_ERR(hpage)) {
> - ret = PTR_ERR(hpage);
> + if (!hpage) {
> + ret = -EINVAL;
> goto err;
> }
> }
>
> I am not sure about ret value in case of failure, so I am looking for any
> reviews :)
You're right. Smatch is sort of supposed to warn about this but
pagecache_get_page() is too complicated.
regards,
dan carpenter
The vmw_gmrid_man_get_node() function calls vmw_host_printf() while
holding a spinlock so these functions need to be atomic. Generally,
no one expects printf() functions to sleep.
Fixes: cfdc3458db8a ("drm/vmwgfx: Be a lot more flexible with MOB limits")
Signed-off-by: Dan
If the intel_engine_create_pinned_context() function returns an error
pointer, then dereferencing "ce" will Oops. Use "vm" instead of
"ce->vm".
Fixes: cf586021642d ("drm/i915/gt: Pipelined page migration")
Signed-off-by: Dan Carpenter
---
drivers/gpu
busy_bo = NULL;
665 spin_unlock(&bo->bdev->lru_lock);
^^
Dereference
666 ret = ttm_mem_evict_wait_busy(busy_bo, ctx, ticket);
667 if (busy_bo)
regards,
dan carpenter
_
gt;= max_param_num)
goto done;
while (*p && isspace(*p))
p++;
sub_str = strsep(&p, delimiter);
ret = kstrtol(sub_str, 16, &(param[param_index]));
if (ret)
goto done;
The dp->train_set[] for this driver is only two characters, not four so
this memsets too much. Fortunately, this ends up corrupting a struct
hole and not anything important.
Fixes: d76271d22694 ("drm: xlnx: DRM/KMS driver for Xilinx ZynqMP DisplayPort
Subsystem")
Signed-off-by:
3 of_node_put(port_node);
674
675 end:
676 return ret;
677
678 err_free_host_node:
679 of_node_put(lt->host_node);
680 return ret;
681 }
regards,
dan carpenter
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
On Wed, Mar 31, 2021 at 11:12:38AM +0300, Dan Carpenter wrote:
>644 of_node_put(endpoint);
>645
>646 lt->host_node = of_graph_get_remote_node(dev->of_node, 0, -1);
>647 if (!lt->host_node) {
>648 dev_err(lt-
ould you use Reported-by?
regards,
dan carpenter
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
On Wed, Mar 31, 2021 at 11:38:22AM +0200, Adrien Grassein wrote:
> Some issues where found during static analysis of this driver.
>
> Reported-by: Dan Carpenter
> Suggested-by: Dan Carpenter
> Signed-off-by: Adrien Grassein
> ---
> drivers/gpu/drm/bridge/l
uot;, __func__);
> + of_node_put(port_node);
> ret = -EINVAL;
> + goto err_free_host_node;
> }
>
> of_node_put(port_node);
Also, btw the success path does "return ret;" but it would be nicer to
"return 0;".
regards,
dan carpenter
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
int);
> + if (data_lanes < 0) {
> + dev_err(lt->dev, "%s: Bad data-lanes property\n", __func__);
> + return lt->data_lanes;
This needs to be "return data_lanes;"
> + }
> + lt->data_lanes = data_lanes;
I really be
Thanks!
regards,
dan carpenter
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
s just
of_node_put(lt->host_node);
But, yeah, putting the of_node_put() after the label isn't bug so
whatever...
regards,
dan carpenter
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
On Wed, Mar 31, 2021 at 03:33:13PM +0200, Adrien Grassein wrote:
> A static analysis shows several issues in the driver code at
> probing time.
>
> DT parsing errors were bad handled and could lead to bugs:
> - Bad error detection;
> - Bad release of ressources
>
> Re
.config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
Reported-by: Dan Carpenter
New smatch warnings:
drivers/video/fbdev/core/fbcon.c:1336 fbcon_cursor() warn: variable
dereferenced before check 'ops&
-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
Reported-by: Dan Carpenter
smatch warnings:
drivers/gpu/drm/i915/display/intel_dp_hdcp.c:582 intel_dp_hdcp2_read_msg()
error: uninitialized symbol 'msg_end'.
vim
)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
Reported-by: Dan Carpenter
smatch warnings:
drivers/gpu/drm/i915/display/intel_hdcp.c:817 _intel_hdcp_disable() error:
uninitialized symbol 'ret'.
vim
The devm_memremap() function never returns NULL, it returns error
pointers so the test needs to be fixed. Also we need to call
pci_release_regions() to avoid a memory leak.
Fixes: be4f77ac6884 ("drm/vmwgfx: Cleanup fifo mmio handling")
Signed-off-by: Dan Carpenter
---
drivers/gpu/
e.
Fixes: 493f30cd086e ("drm/i915/gvt: parse init context to update cmd accessible
reg whitelist")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/i915/gvt/cmd_parser.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c
b/d
On Mon, Jan 25, 2021 at 07:13:43PM +, Zack Rusin wrote:
>
>
> > On Jan 25, 2021, at 03:45, Dan Carpenter wrote:
> >
> > The devm_memremap() function never returns NULL, it returns error
> > pointers so the test needs to be fixed. Also we need to call
> &
t; + reinit_completion(&spi_panel_te);
> + rc = wait_for_completion_timeout(&spi_panel_te,
> +
> msecs_to_jiffies(SPI_PANEL_TE_TIMEOUT));
> + if (rc == 0)
> +
On Mon, Jan 25, 2021 at 04:44:12PM +0800, Carlis wrote:
> From: "carlis.zhang_cp"
I was really expecting that you would fix this and Signed-off-by as
well.
regards,
dan carpenter
___
dri-devel mailing list
dri-devel@lists.freedesk
par->gpio.te = NULL;
> + } else {
> + disable_irq_nosync(gpiod_to_irq(par->gpio.te));
> + pr_info("TE request_irq completion.\n");
> + }
> + } else {
> + pr_err("%s:%d, TE g
s and return the error code. Write it exactly like
this:
par->gpio.te = devm_gpiod_get_index_optional(dev, "te", 0, GPIOD_IN);
if (IS_ERR(par->gpio.te))
return PTR_ERR(par->gpio.te);
if (par->gpio.te) {
init_completion(&
x27;t print anything on the success path. You should add that to your
code while your debugging the feature, but don't push it to the upstream
kernel.
> + }
> + } else {
> + pr_info("%s:%d, TE gpio not specified\n",
> +
("Failed to request te gpio: %d\n", rc);
> par->gpio.te = NULL;
> }
I wish you would just copy and paste the code that I sent you instead,
but this also fixes the crash...
regards,
dan carpenter
___
dri-dev
+ disable_irq_nosync(gpiod_to_irq(par->gpio.te));
> + pr_info("TE request_irq completion.\n");
#SadFaceEmoji
> + }
> + } else {
> + pr_info("%s:%d, TE gpio not specified\n",
> + __func__, __LINE_
ng wrong here that is missing the fact that
> a line is being indented with spaces and not tabs in the patch
> at
> https://lore.kernel.org/r/1611754972-151016-1-git-send-email-zhangxuez...@gmail.com
>
> Any ideas what broke?
>
/*Tearing Effect Line On*/
Comments are the exception to the "no spaces at the start of a line"
rule. I was expecting that the kbuild-bot would send a Smatch warning
for inconsistent indenting, but comments are not counted there either.
I'm sort of surprised that we don't have checkpatch rule about the
missing space characters. It should be: "/* Tearing Effect Line On */".
regards,
dan carpenter
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
ror. The user should fix the
error or disable the feature if they want to continue.
There are lots of places in the kernel where the error handling could
be written to try continue but in a crippled state. It's not the right
approach. Over engineering like that just leads to bugs.
r
ed. Ditto for
> PTR_ERR(). Have you even looked for these macros implementations?
>
Yeah... It leads to a compile warning:
warning: passing argument 1 of ‘IS_ERR’ makes pointer from integer
without a cast [-Wint-conversion]
regards,
dan carpenter
__
If devm_request_mem_region() fails this code currently returns success
but it should return -EBUSY.
Fixes: 6076a9711dc5 ("drm/virtio: implement blob resources: probe for host
visible region")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/virtio/virtgpu_kms.c | 1 +
1 file
u fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
Reported-by: Dan Carpenter
New smatch warnings:
drivers/gpu/drm/ttm/ttm_device.c:144 ttm_device_swapout() warn: variable
dereferenced before check 'bo->ttm' (see line 142)
vim +144 d
cache.")
Signed-off-by: Dan Carpenter
---
I sent this patch last June but it was never applied.
drivers/gpu/drm/vc4/vc4_bo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
index 72d30d90b856c..0af246a5609ca 100644
---
these arrays as having HDCP_MESSAGE_ID_MAX
entries. This doesn't change the code, but it's just a belt and
suspenders approach to try future proof the code.
Fixes: 4c283fdac08a ("drm/amd/display: Add HDCP module")
Signed-off-by: Dan Carpenter
---
>From static analysis, as
ctory then
the debugfs_create_file will check if the root is an error pointer. So
passing it "handles" errors itself.
The one time where I've seen that checking for errors is essential is
if they driver dereferences the "test_data" dentry itself. That's
pretty uncom
1005 return -ENOMEM;
1006 }
1007 entry->seglist[entry->seg_count++] = dmah;
1008 for (i = 0; i < (1 << page_order); i++) {
1009 DRM_DEBUG("page %d @ 0x%08lx\n",
regards,
dan carpenter
>static_buffer == NULL))
> + if (unlikely(fifo->static_buffer == NULL)) {
> + kfree(fifo);
> return ERR_PTR(-ENOMEM);
> + }
regards,
dan carpenter
On Fri, May 14, 2021 at 09:34:27AM -0700, Joseph Kogut wrote:
> On Fri, May 14, 2021 at 8:13 AM Joseph Kogut wrote:
> >
> > Hi Dan,
> >
> > On Fri, May 14, 2021 at 6:54 AM Dan Carpenter
> > wrote:
> > >
> > > Hello Joseph Kogut,
> &
This code is passing the wrong variable to PTR_ERR() so it doesn't
return the correct error code.
Fixes: 988156dc2fc9 ("drm: bridge: add it66121 driver")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-
: add it66121 driver")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/bridge/ite-it66121.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ite-it66121.c
b/drivers/gpu/drm/bridge/ite-it66121.c
index 6980c9801d0d..7149ed40af83 100644
--- a/d
).
Fixes: 11e8f5fd223b ("drm: Add simpledrm driver")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/tiny/simpledrm.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
index f72ca3a1c2d4..4f
There is a reversed if statement in this probe function so the driver is
completely broken.
Fixes: dc13cac4862c ("video: hgafb: fix potential NULL pointer dereference")
Signed-off-by: Dan Carpenter
---
drivers/video/fbdev/hgafb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
406d9679 ("drm/bridge: ti-sn65dsi86: If refclk, DP AUX can happen
w/out pre-enable")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
b/drivers/gpu
On Fri, Nov 20, 2020 at 10:15:57PM +, Chrisanthus, Anitha wrote:
> Hi Dan,
> I see the problem now, thanks for the patch.
>
> > -Original Message-----
> > From: Dan Carpenter
> > Sent: Friday, November 20, 2020 12:11 AM
> > To: Chrisanthus, Anitha
>
of a warning.
>
> FWIW, this series has found at least one bug so far:
> https://lore.kernel.org/lkml/CAFCwf11izHF=g1mGry1fE5kvFFFrxzhPSM6qKAO8gxSp=kr...@mail.gmail.com/
This is a fallthrough to a return and not to a break. That should
trigger a warning. The fallthrough to a break should not generate a
warning.
The bug we're trying to fix is "missing break statement" but if the
result of the bug is "we hit a break statement" then now we're just
talking about style. GCC should limit itself to warning about
potentially buggy code.
regards,
dan carpenter
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
h (x) {
> case 0:
> ++x;
> default:
> ;
> }
Don't warn for this.
If adding a break statement changes the flow of the code then warn about
potentially missing break statements, but if it doesn't change anything
then don't warn about it.
regards,
dan carpenter
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
ved the
WARNING message if kzalloc() fails and updated the label names.
Fixes: 1b082ccf5901 ("gma500: Add Oaktrail support")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c | 22 +-
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git
There is a copy and paste bug in this code. It's supposed to check
"obj2" instead of checking "obj" a second time.
Fixes: 80f0b679d6f0 ("drm/i915: Add an implementation for i915_gem_ww_ctx
locking, v2.")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/i9
the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
Reported-by: Dan Carpenter
smatch warnings:
drivers/gpu/drm/drm_dp_helper.c:3185 drm_dp_pcon_convert_rgb_to_ycbcr() warn:
was && intended here instead of ||?
vim +3185 drivers/gpu/drm/drm_dp_helper
There is a copy and paste bug so it didn't return the correct error
code.
Fixes: b215212117f7 ("drm: panel: add Khadas TS050 panel driver")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/panel/panel-khadas-ts050.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --gi
9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
Reported-by: Dan Carpenter
New smatch warnings:
drivers/gpu/drm/i915/gt/selftest_migrate.c:102 copy() error: uninitialized
symbol 'rq'.
drivers/gpu/drm/i915/gt/selftest_migrate.
(Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
Reported-by: Dan Carpenter
New smatch warnings:
drivers/gpu/drm/i915/selftests/intel_memory_region.c:227 igt_mock_reserve()
error: 'mem' dereferencing possible ERR_PTR()
On Fri, Jul 02, 2021 at 11:32:45AM +0100, Matthew Auld wrote:
> On Fri, 2 Jul 2021 at 09:45, Dan Carpenter wrote:
> >
> > tree: git://anongit.freedesktop.org/drm-intel drm-intel-gt-next
> > head: 5cd57f676bb946a00275408f0dd0d75dbc466d25
> > commit: cf586021642d8017
On Fri, Jul 02, 2021 at 02:07:27PM +0300, Dan Carpenter wrote:
> On Fri, Jul 02, 2021 at 11:32:45AM +0100, Matthew Auld wrote:
> > On Fri, 2 Jul 2021 at 09:45, Dan Carpenter wrote:
> > > cf586021642d80 Chris Wilson 2021-06-17 84
> > > cf586021642d80 Chris Wilson 2021
f we
> see -EDEADLK(which involves dropping some locks), if we see any other
> error then the loop is terminated with ww->loop = false, which then
> hits the goto err_out.
>
Ah, yeah, you're right. False positive.
I hadn't looked at this code in context (I only had reviewed the email).
Now that I've pulled the tree and looked at the code, then I'm sort of
surprised that Smatch generates a warning... I will investigate some
more. Thanks!
regards,
dan carpenter
"buf_size" to int.
Fixes: 79beb6114014 ("drm/amdgpu: Optimize EEPROM RAS table I/O")
Signed-off-by: Dan Carpenter
---
It's hard for me to tell the exact upper bound that "buf_size" can be,
but if it's over USHRT_MAX then we are well toasted.
drivers/g
y changing the < to != which works regardless of type
promotion.
Fixes: 6cda0af81a50 ("drm/amdgpu: Fixes to the AMDGPU EEPROM driver")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/amd/amdgpu/amdgpu_eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dri
This error path needs to unlock before returning. While we're at it,
the correct error code from copy_to_user() failure is -EFAULT, not
-EINVAL.
Fixes: 9b790694a031 (""drm/amdgpu: RAS EEPROM table is now in debugfs)
Signed-off-by: Dan Carpenter
---
drivers/gpu
If copy_to_user() fails then this should return -EFAULT instead of
-EINVAL.
Fixes: 9b790694a031 ("drm/amdgpu: RAS EEPROM table is now in debugfs")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletion
->chip;
int ret;
> +
> + chip = &ldev->chip;
> + chip->label = "ls7a-dc-gpio";
> + chip->base = LS7A_DC_GPIO_BASE;
> + chip->ngpio = 4;
> + chip->parent = ldev->dev->dev;
> + chip->request = ls_dc_gpio_request;
> + chip->direction_input = ls_dc_gpio_dir_input;
> + chip->direction_output = ls_dc_gpio_dir_output;
> + chip->set = ls_dc_gpio_set;
> + chip->get = ls_dc_gpio_get;
> + chip->can_sleep = false;
> +
> + ret = devm_gpiochip_add_data(ldev->dev->dev, chip, ldev);
> + if (ret) {
> + DRM_ERROR("Failed to register ls7a dc gpio driver\n");
> + return -ENODEV;
return ret;
> + }
> + DRM_INFO("Registered ls7a dc gpio driver\n");
> +
> + return 0;
> +}
> +
> +int loongson_i2c_init(struct loongson_device *ldev)
> +{
> + int ret;
> +
> + ret = gpio_request_array(i2c_gpios, ARRAY_SIZE(i2c_gpios));
> + if (ret) {
> + DRM_ERROR("Failed to request gpio array i2c_gpios\n");
> + return -ENODEV;
return ret;
> + }
> +
> + ldev->i2c_bus[0].i2c_id = 6;
> + ldev->i2c_bus[0].use = true;
> + ldev->i2c_bus[1].i2c_id = 7;
> + ldev->i2c_bus[1].use = true;
> +
> + loongson_i2c_add(ldev, DC_I2C_NAME);
check for errors.
> +
> + return 0;
> +}
> +
> +struct loongson_i2c *loongson_i2c_bus_match(struct loongson_device *ldev,
> u32 i2c_id)
> +{
> + u32 i;
> + struct loongson_i2c *match = NULL, *tables;
> +
> + tables = ldev->i2c_bus;
> +
> + for (i = 0; i < LS_MAX_I2C_BUS; i++) {
table = &ldev->i2c_bus[i];
> + if (tables->i2c_id == i2c_id && tables->init == true) {
> + match = tables;
> + break;
Just return instead of break:
return table;
> + }
> +
> + tables++;
> + }
> +
> + return match;
> +}
regards,
dan carpenter
le_crtcs = 1 << index;
> +
> + drm_encoder_init(ldev->dev, encoder, &loongson_encoder_funcs,
> + DRM_MODE_ENCODER_DAC, NULL);
> +
> + ldev->mode_info[index].encoder = lencoder;
> +
> + return 0;
> +}
> diff --git a/drivers/gpu/drm/loongson/loongson_plane.c
> b/drivers/gpu/drm/loongson/loongson_plane.c
> new file mode 100644
> index ..b8c247d1ce09
> --- /dev/null
> +++ b/drivers/gpu/drm/loongson/loongson_plane.c
> @@ -0,0 +1,102 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +
> +#include "loongson_drv.h"
> +
> +static void loongson_plane_atomic_update(struct drm_plane *plane,
> + struct drm_atomic_state *state)
> +{
> + struct loongson_crtc *lcrtc;
> + struct loongson_device *ldev;
> + struct drm_plane_state *lstate = plane->state;
> + u32 gpu_addr = 0;
> + u32 fb_addr = 0;
> + u32 reg_val = 0;
> + u32 reg_offset;
> + u32 pitch;
> + u8 depth;
> + u32 x, y;
> +
> + if (!lstate->crtc || !lstate->fb)
> + return;
> +
> + pitch = lstate->fb->pitches[0];
> + lcrtc = to_loongson_crtc(lstate->crtc);
> + ldev = lcrtc->ldev;
> + reg_offset = lcrtc->reg_offset;
> + x = lstate->crtc->x;
> + y = lstate->crtc->y;
> + depth = lstate->fb->format->cpp[0] << 3;
> +
> + gpu_addr = loongson_gpu_offset(lstate);
> + reg_val = (pitch + 255) & ~255;
> + ls7a_mm_wreg(ldev, FB_STRI_REG + reg_offset, reg_val);
> +
> + switch (depth) {
> + case 12 ... 16:
> + fb_addr = gpu_addr + y * pitch + ALIGN(x, 64) * 2;
> + break;
> + case 24 ... 32:
> + default:
> + fb_addr = gpu_addr + y * pitch + ALIGN(x, 64) * 4;
> + break;
> + }
> +
> + ls7a_mm_wreg(ldev, FB_ADDR0_REG + reg_offset, fb_addr);
> + ls7a_mm_wreg(ldev, FB_ADDR1_REG + reg_offset, fb_addr);
> + reg_val = lcrtc->cfg_reg | CFG_ENABLE;
> + ls7a_mm_wreg(ldev, FB_CFG_REG + reg_offset, reg_val);
> +}
> +
> +static const uint32_t loongson_formats[] = {
> + DRM_FORMAT_RGB565,
> + DRM_FORMAT_RGB888,
> + DRM_FORMAT_XRGB,
> + DRM_FORMAT_ARGB,
> +};
> +
> +static const uint64_t loongson_format_modifiers[] = { DRM_FORMAT_MOD_LINEAR,
> + DRM_FORMAT_MOD_INVALID };
> +
> +static const struct drm_plane_funcs loongson_plane_funcs = {
> + .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
> + .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
> + .destroy = drm_plane_cleanup,
> + .disable_plane = drm_atomic_helper_disable_plane,
> + .reset = drm_atomic_helper_plane_reset,
> + .update_plane = drm_atomic_helper_update_plane,
> +};
> +
> +static const struct drm_plane_helper_funcs loongson_plane_helper_funcs = {
> + .prepare_fb = drm_gem_vram_plane_helper_prepare_fb,
> + .cleanup_fb = drm_gem_vram_plane_helper_cleanup_fb,
> + .atomic_update = loongson_plane_atomic_update,
> +};
> +
> +int loongson_plane_init(struct loongson_crtc *lcrtc)
> +{
> + struct loongson_device *ldev;
> + int crtc_id;
> + int ret;
> +
> + ldev = lcrtc->ldev;
> + crtc_id = lcrtc->crtc_id;
> +
> + lcrtc->plane = devm_kzalloc(ldev->dev->dev, sizeof(*lcrtc->plane),
Why do we use ->dev->dev here and ->dev for drm_universal_plane_init()?
> + GFP_KERNEL);
> + if (!lcrtc->plane)
> + return -ENOMEM;
> +
> + ret = drm_universal_plane_init(ldev->dev, lcrtc->plane, BIT(crtc_id),
> +&loongson_plane_funcs, loongson_formats,
> +ARRAY_SIZE(loongson_formats),
> +loongson_format_modifiers,
> +DRM_PLANE_TYPE_PRIMARY, NULL);
> + if (ret) {
> + DRM_ERROR("fail to init planed crtc %d\n", crtc_id);
> + return ret;
> + }
> +
> + drm_plane_helper_add(lcrtc->plane, &loongson_plane_helper_funcs);
> +
> + return 0;
> +}
regards,
dan carpenter
reg_val |= FB_VSYNC1_ENABLE;
> + ls7a_mm_wreg(ldev, FB_INT_REG, reg_val);
> + } else {
> + reg_val = ls7a_mm_rreg(ldev, FB_INT_REG);
> + reg_val |= FB_VSYNC0_ENABLE;
> + ls7a_mm_wreg(ldev, FB_INT_REG, reg_val);
> + }
> +
> + return 0;
> +}
> +
> +void loongson_crtc_disable_vblank(struct drm_crtc *crtc)
> +{
> + struct loongson_crtc *lcrtc = to_loongson_crtc(crtc);
> + struct loongson_device *ldev = lcrtc->ldev;
> + u32 reg_val;
> +
> + if (lcrtc->crtc_id) {
> + reg_val = ls7a_mm_rreg(ldev, FB_INT_REG);
> + reg_val &= ~FB_VSYNC1_ENABLE;
> + ls7a_mm_wreg(ldev, FB_INT_REG, reg_val);
> + } else {
> + reg_val = ls7a_mm_rreg(ldev, FB_INT_REG);
> + reg_val &= ~FB_VSYNC0_ENABLE;
> + ls7a_mm_wreg(ldev, FB_INT_REG, reg_val);
> + }
More readable to pull the common code in one place:
reg_val = ls7a_mm_rreg(ldev, FB_INT_REG);
if (lcrtc->crtc_id)
reg_val &= ~FB_VSYNC1_ENABLE;
else
reg_val &= ~FB_VSYNC0_ENABLE;
ls7a_mm_wreg(ldev, FB_INT_REG, reg_val);
> +}
> +
regards,
dan carpenter
return 0;
> +}
[ snip ]
> +int loongson_modeset_init(struct loongson_device *ldev)
> +{
> + struct drm_encoder *encoder;
> + struct drm_connector *connector;
> + int i;
> + u32 ret;
Same.
> +
> + ldev->dev->mode_config.allow_fb_modifiers = true;
regards,
dan carpenter
.config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
Reported-by: Dan Carpenter
New smatch warnings:
drivers/gpu/drm/drm_irq.c:175 drm_irq_uninstall() warn: variable dereferenced
before check 'dev' (se
too late to replace it. Just
send a patch to fix it.
regards,
dan carpenter
> Jianxin
>
> > -----Original Message-
> > From: Dan Carpenter
> > Sent: Monday, November 02, 2020 12:15 AM
> > To: Xiong, Jianxin
> > Cc: dri-devel@lists.freedesktop.org
> >
; will trigger a false positive
and the "if (ret) " will not.
int var;
ret = frob(&var);
if (ret < 0)
return ret;
Smatch thinks positive returns are not handled so it complains that
"var can be uninitialized".
regards,
dan carpenter
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
If udl_get_urb() fails then this should return a negative error code
but currently it returns success.
Fixes: 798ce3fe1c3a ("drm/udl: Begin/end access to imported buffers in
damage-handler")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/udl/udl_modeset.c | 4 +++-
1 file
(Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot
Reported-by: Dan Carpenter
smatch warnings:
drivers/gpu/drm/drm_atomic_uapi.c:342 drm_atomic_set_crtc_for_connector()
error: we previously assumed 'crtc' could be null
so the check can just be
removed.
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/kmb/kmb_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/kmb/kmb_drv.c b/drivers/gpu/drm/kmb/kmb_drv.c
index 8c43b136765c..5ff392644603 100644
--- a/drivers/gpu/drm/kmb/km
If kmb_dsi_init() fails the error handling will dereference an error
pointer which will cause an Oops.
Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display")
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/kmb/kmb_drv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletion
On Thu, Nov 19, 2020 at 12:35:56PM +0100, Hans de Goede wrote:
> Hi,
>
> On 10/27/20 2:51 PM, Hans de Goede wrote:
> > Add missing pci_iounmap() calls to properly unmap the memory on
> > probe-failure and remove.
> >
> > Reported-by: kernel test robot
> >
On Thu, Nov 19, 2020 at 08:30:59PM +0100, Daniel Vetter wrote:
> On Thu, Nov 19, 2020 at 6:51 PM Dan Carpenter
> wrote:
> >
> > On Thu, Nov 19, 2020 at 12:35:56PM +0100, Hans de Goede wrote:
> > > Hi,
> > >
> > > On 10/27/20 2:51 PM, Hans de Goede w
On Fri, Nov 20, 2020 at 01:29:45AM +, Chrisanthus, Anitha wrote:
> Hi Dan,
>
> > -Original Message-
> > From: Dan Carpenter
> > Sent: Monday, November 16, 2020 11:21 PM
> > To: Chrisanthus, Anitha
> > Cc: Dea, Edmund J ; David Airlie ;
> >
If kmb_dsi_init() fails the "kmb->kmb_dsi" variable is an error pointer.
The kernel will Oops when we pass it to kmb_dsi_host_unregister().
Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display")
Signed-off-by: Dan Carpenter
---
v2: write a better commit messag
On Fri, Nov 20, 2020 at 10:39:45AM +0100, Daniel Vetter wrote:
> On Fri, Nov 20, 2020 at 8:58 AM Dan Carpenter
> wrote:
> >
> > On Thu, Nov 19, 2020 at 08:30:59PM +0100, Daniel Vetter wrote:
> > > On Thu, Nov 19, 2020 at 6:51 PM Dan Carpenter
> > > wrote:
This post-op should be a pre-op so that we do not pass -1 as the bit
number to test_bit(). The current code will loop downwards from 63 to
-1. After changing to a pre-op, it loops from 63 to 0.
Fixes: 71c37505e7ea ("drm/amdgpu/gfx: move more common KIQ code to
amdgpu_gfx.c")
Signed-o
NOMEM. Or maybe this is meant to be checking for an empty
string?
> +
> + if (!*cmd)
> + *cmd = kstrdup_quotable_cmdline(task, GFP_KERNEL);
Same.
>
> put_task_struct(task);
> }
regards,
dan carpenter
dup(task->comm, GFP_KERNEL);
> >
> > What?
> >
> > If the first allocation failed, then this one is going to fail as well.
> > Just return -ENOMEM. Or maybe this is meant to be checking for an empty
> > string?
>
> fwiw, if ctx->comm is NULL, the kstrdup() will return NULL, so this
> isn't intended to deal with OoM, but the case that comm and/or cmdline
> is not overridden.
Ah, I should have thought about that. Thanks!
regards,
dan carpenter
break;
> + }
> }
> - if (&req->req != _req) {
> + if (!req) {
> ep->stopped = stopped;
> spin_unlock_irqrestore(&ep->dev->lock, flags);
> return -EINVAL;
> @@ -954,7 +957,6 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request
> *_req)
> dev_dbg(ep->dev->dev, "unlink (%s) pio\n", _ep->name);
> net2272_done(ep, req, -ECONNRESET);
> }
> - req = NULL;
Another unrelated change. These are all good changes but send them as
separate patches.
> ep->stopped = stopped;
>
> spin_unlock_irqrestore(&ep->dev->lock, flags);
regards,
dan carpenter
--
> drivers/media/pci/saa7134/saa7134-alsa.c | 4 ++--
> drivers/perf/xgene_pmu.c | 13 +++--
> 3 files changed, 11 insertions(+), 10 deletions(-)
These are all bug fixes.
1) Send them as 3 separate patches.
2) Add Fixes tags.
regards,
dan carpenter
1 - 100 of 1581 matches
Mail list logo