All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: dri-devel@lists.freedesktop.org
Cc: kernel test robot <lkp@intel.com>
Subject: [PATCH 1/2] drm/gud: fix sizeof use
Date: Mon, 22 Mar 2021 18:44:33 +0100	[thread overview]
Message-ID: <20210322174434.58849-1-noralf@tronnes.org> (raw)

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

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)) {
-- 
2.23.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2021-03-22 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 17:44 Noralf Trønnes [this message]
2021-03-22 17:44 ` [PATCH 2/2] drm/gud: Remove unneeded semicolon Noralf Trønnes
2021-03-23  9:40 ` [PATCH 1/2] drm/gud: fix sizeof use Noralf Trønnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210322174434.58849-1-noralf@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.