All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: xji@analogixsemi.com
Cc: dri-devel@lists.freedesktop.org
Subject: [bug report] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP
Date: Wed, 17 Nov 2021 16:47:20 +0300	[thread overview]
Message-ID: <20211117134720.GA6968@kili> (raw)

Hello Xin Ji,

The patch 8bdfc5dae4e3: "drm/bridge: anx7625: Add anx7625 MIPI
DSI/DPI to DP" from Sep 18, 2020, leads to the following Smatch
static checker warning:

	drivers/gpu/drm/bridge/analogix/anx7625.c:1050 anx7625_init_gpio()
	warn: 'platform->pdata.gpio_p_on' could be an error pointer

	drivers/gpu/drm/bridge/analogix/anx7625.c:1050 anx7625_init_gpio()
	warn: 'platform->pdata.gpio_reset' could be an error pointer

drivers/gpu/drm/bridge/analogix/anx7625.c
    1037 static void anx7625_init_gpio(struct anx7625_data *platform)
    1038 {
    1039         struct device *dev = &platform->client->dev;
    1040 
    1041         DRM_DEV_DEBUG_DRIVER(dev, "init gpio\n");
    1042 
    1043         /* Gpio for chip power enable */
    1044         platform->pdata.gpio_p_on =
    1045                 devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
    1046         /* Gpio for chip reset */
    1047         platform->pdata.gpio_reset =
    1048                 devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
    1049 
--> 1050         if (platform->pdata.gpio_p_on && platform->pdata.gpio_reset) {
    1051                 platform->pdata.low_power_mode = 1;
    1052                 DRM_DEV_DEBUG_DRIVER(dev, "low power mode, pon %d, reset %d.\n",
    1053                                      desc_to_gpio(platform->pdata.gpio_p_on),
                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^
    1054                                      desc_to_gpio(platform->pdata.gpio_reset));
                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
This will crash here but only when there is an error and debugging is
enabled.

    1055         } else {
    1056                 platform->pdata.low_power_mode = 0;
    1057                 DRM_DEV_DEBUG_DRIVER(dev, "not low power mode.\n");
    1058         }
    1059 }

regards,
dan carpenter

             reply	other threads:[~2021-11-17 13:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 13:47 Dan Carpenter [this message]
2021-11-18  2:54 ` [bug report] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP Xin Ji

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=20211117134720.GA6968@kili \
    --to=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=xji@analogixsemi.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.