Re: [bug report] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 17, 2021 at 04:47:20PM +0300, Dan Carpenter wrote:
> 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

Hi Dan Carpenter, thanks for the report, I'll upstream a patch to fix it.

Thanks,
Xin
> 
> 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



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux