From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCHv3] drm/xe/display: check for error on drmm_mutex_init
Date: Thu, 4 Apr 2024 17:10:56 +0530 [thread overview]
Message-ID: <90c7e015-9bba-49cc-bf52-970952c8fa4a@intel.com> (raw)
In-Reply-To: <20240403140105.1306622-1-arun.r.murthy@intel.com>
On 03-04-2024 19:31, Arun R Murthy wrote:
> Check return value for drmm_mutex_init as it can fail and return on
> failure.
>
> v2: Removed nested if (Lucas)
> v3: Revert back to nested if (Andi)
>
> Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
> ---
> drivers/gpu/drm/xe/display/xe_display.c | 30 ++++++++++++++++++++-----
> 1 file changed, 24 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> index e4db069f0db3..04b83ca5168c 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -107,12 +107,30 @@ int xe_display_create(struct xe_device *xe)
>
> xe->display.hotplug.dp_wq = alloc_ordered_workqueue("xe-dp", 0);
>
> - drmm_mutex_init(&xe->drm, &xe->sb_lock);
> - drmm_mutex_init(&xe->drm, &xe->display.backlight.lock);
> - drmm_mutex_init(&xe->drm, &xe->display.audio.mutex);
> - drmm_mutex_init(&xe->drm, &xe->display.wm.wm_mutex);
> - drmm_mutex_init(&xe->drm, &xe->display.pps.mutex);
> - drmm_mutex_init(&xe->drm, &xe->display.hdcp.hdcp_mutex);
> + err = drmm_mutex_init(&xe->drm, &xe->sb_lock);
> + if (err)
> + return err;
Make sure to destroy workqueue before return.
> +
> + err = drmm_mutex_init(&xe->drm, &xe->display.backlight.lock);
> + if (err)
> + return err;
> +
> + err = drmm_mutex_init(&xe->drm, &xe->display.audio.mutex);
> + if (err)
> + return err;
> +
> + err = drmm_mutex_init(&xe->drm, &xe->display.wm.wm_mutex);
> + if (err)
> + return err;
> +
> + err = drmm_mutex_init(&xe->drm, &xe->display.pps.mutex);
> + if (err)
> + return err;
> +
> + err = drmm_mutex_init(&xe->drm, &xe->display.hdcp.hdcp_mutex);
> + if (err)
> + return err;
> +
> xe->enabled_irq_mask = ~0;
>
> err = drmm_add_action_or_reset(&xe->drm, display_destroy, NULL);
prev parent reply other threads:[~2024-04-04 11:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 14:01 [PATCHv3] drm/xe/display: check for error on drmm_mutex_init Arun R Murthy
2024-04-03 14:16 ` ✓ CI.Patch_applied: success for drm/xe/display: check for error on drmm_mutex_init (rev4) Patchwork
2024-04-03 14:17 ` ✓ CI.checkpatch: " Patchwork
2024-04-03 14:18 ` ✓ CI.KUnit: " Patchwork
2024-04-03 14:29 ` ✓ CI.Build: " Patchwork
2024-04-03 14:32 ` ✓ CI.Hooks: " Patchwork
2024-04-03 14:33 ` ✓ CI.checksparse: " Patchwork
2024-04-03 15:07 ` ✓ CI.BAT: " Patchwork
2024-04-04 11:40 ` Ghimiray, Himal Prasad [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=90c7e015-9bba-49cc-bf52-970952c8fa4a@intel.com \
--to=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/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