From: neil.armstrong@linaro.org
To: Haoran Liu <liuhaoran14@163.com>, maarten.lankhorst@linux.intel.com
Cc: mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
daniel@ffwll.ch, khilman@baylibre.com, jbrunet@baylibre.com,
martin.blumenstingl@googlemail.com,
dri-devel@lists.freedesktop.org,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [drm/meson] meson_plane: Add error handling
Date: Wed, 29 Nov 2023 10:27:11 +0100 [thread overview]
Message-ID: <e7a2db20-4d6c-4fd0-ba0e-d8a2057cfbfc@linaro.org> (raw)
In-Reply-To: <20231129092113.32630-1-liuhaoran14@163.com>
Hi,
Thanks for your patch!
On 29/11/2023 10:21, Haoran Liu wrote:
> This patch adds robust error handling to the meson_plane_create
> function in drivers/gpu/drm/meson/meson_plane.c. The function
> previously lacked proper handling for potential failure scenarios
> of the drm_universal_plane_init call.
>
> Signed-off-by: Haoran Liu <liuhaoran14@163.com>
> ---
> drivers/gpu/drm/meson/meson_plane.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c
> index 815dfe30492b..67b36398f146 100644
> --- a/drivers/gpu/drm/meson/meson_plane.c
> +++ b/drivers/gpu/drm/meson/meson_plane.c
> @@ -534,6 +534,7 @@ int meson_plane_create(struct meson_drm *priv)
> struct meson_plane *meson_plane;
> struct drm_plane *plane;
> const uint64_t *format_modifiers = format_modifiers_default;
> + int ret;
>
> meson_plane = devm_kzalloc(priv->drm->dev, sizeof(*meson_plane),
> GFP_KERNEL);
> @@ -548,12 +549,16 @@ int meson_plane_create(struct meson_drm *priv)
> else if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A))
> format_modifiers = format_modifiers_afbc_g12a;
>
> - drm_universal_plane_init(priv->drm, plane, 0xFF,
> + ret = drm_universal_plane_init(priv->drm, plane, 0xFF,
> &meson_plane_funcs,
> supported_drm_formats,
> ARRAY_SIZE(supported_drm_formats),
> format_modifiers,
> DRM_PLANE_TYPE_PRIMARY, "meson_primary_plane");
Could you re-align those lines aswell ?
> + if (ret) {
> + devm_kfree(priv->drm->dev, meson_plane);
> + return ret;
> + }
>
> drm_plane_helper_add(plane, &meson_plane_helper_funcs);
>
Thanks,
Neil
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
prev parent reply other threads:[~2023-11-29 9:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 9:21 [PATCH] [drm/meson] meson_plane: Add error handling Haoran Liu
2023-11-29 9:27 ` neil.armstrong [this message]
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=e7a2db20-4d6c-4fd0-ba0e-d8a2057cfbfc@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuhaoran14@163.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).