diff mbox series

[1/2] drm/gud: fix sizeof use

Message ID 20210322174434.58849-1-noralf@tronnes.org (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/gud: fix sizeof use | expand

Commit Message

Noralf Trønnes March 22, 2021, 5:44 p.m. UTC
From: kernel test robot <lkp@intel.com>

drivers/gpu/drm/gud/gud_connector.c:710:37-43: ERROR: application of sizeof to pointer

 sizeof when applied to a pointer typed expression gives the size of
 the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
[fix subject]
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/gpu/drm/gud/gud_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Noralf Trønnes March 23, 2021, 9:40 a.m. UTC | #1
Den 22.03.2021 18.44, skrev Noralf Trønnes:
> From: kernel test robot <lkp@intel.com>
> 
> drivers/gpu/drm/gud/gud_connector.c:710:37-43: ERROR: application of sizeof to pointer
> 
>  sizeof when applied to a pointer typed expression gives the size of
>  the pointer
> 
> Generated by: scripts/coccinelle/misc/noderef.cocci
> 
> Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> [fix subject]
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> ---

Both patches are applied to drm-misc-next.

Noralf.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/gud/gud_connector.c b/drivers/gpu/drm/gud/gud_connector.c
index ec495dcd6122..9ae5a0020449 100644
--- a/drivers/gpu/drm/gud/gud_connector.c
+++ b/drivers/gpu/drm/gud/gud_connector.c
@@ -707,7 +707,7 @@  int gud_get_connectors(struct gud_device *gdrm)
 		return -ENOMEM;
 
 	ret = gud_usb_get(gdrm, GUD_REQ_GET_CONNECTORS, 0,
-			  descs, GUD_CONNECTORS_MAX_NUM * sizeof(descs));
+			  descs, GUD_CONNECTORS_MAX_NUM * sizeof(*descs));
 	if (ret < 0)
 		goto free;
 	if (!ret || ret % sizeof(*descs)) {