[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAA8EJpq9x5RY05cKzq7MoMzdKRBkj3y_Hy3gpmKfZVMqK123ow@mail.gmail.com>
Date: Sun, 24 Sep 2023 12:33:46 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: liuhaoran <liuhaoran14@....com>
Cc: robdclark@...il.com, quic_abhinavk@...cinc.com, airlied@...il.com,
daniel@...ll.ch, linux-arm-msm@...r.kernel.org,
dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/msm/mdp4: Add error handling in mdp4_lvds_connector_init()
On Sun, 24 Sept 2023 at 09:42, liuhaoran <liuhaoran14@....com> wrote:
>
> This patch adds error-handling for the drm_connector_init() and
> drm_connector_attach_encoder inside the mdp4_lvds_connector_init().
>
> Signed-off-by: liuhaoran <liuhaoran14@....com>
As pointed out by the kernel robot, this was not even compile tested.
So NAK. Please use proper casts for error returns.
> ---
> .../gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c
> index 7444b75c4215..62eb363ba90f 100644
> --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c
> +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_lvds_connector.c
> @@ -96,6 +96,7 @@ struct drm_connector *mdp4_lvds_connector_init(struct drm_device *dev,
> {
> struct drm_connector *connector = NULL;
> struct mdp4_lvds_connector *mdp4_lvds_connector;
> + int ret;
>
> mdp4_lvds_connector = kzalloc(sizeof(*mdp4_lvds_connector), GFP_KERNEL);
> if (!mdp4_lvds_connector)
> @@ -106,8 +107,12 @@ struct drm_connector *mdp4_lvds_connector_init(struct drm_device *dev,
>
> connector = &mdp4_lvds_connector->base;
>
> - drm_connector_init(dev, connector, &mdp4_lvds_connector_funcs,
> - DRM_MODE_CONNECTOR_LVDS);
> + ret = drm_connector_init(dev, connector, &mdp4_lvds_connector_funcs,
> + DRM_MODE_CONNECTOR_LVDS);
> +
> + if (ret)
> + return ret;
> +
> drm_connector_helper_add(connector, &mdp4_lvds_connector_helper_funcs);
>
> connector->polled = 0;
> @@ -115,7 +120,10 @@ struct drm_connector *mdp4_lvds_connector_init(struct drm_device *dev,
> connector->interlace_allowed = 0;
> connector->doublescan_allowed = 0;
>
> - drm_connector_attach_encoder(connector, encoder);
> + ret = drm_connector_attach_encoder(connector, encoder);
> +
> + if (ret)
> + return ret;
>
> return connector;
> }
> --
> 2.17.1
>
--
With best wishes
Dmitry
Powered by blists - more mailing lists