From: Jani Nikula <jani.nikula@linux.intel.com>
To: Arun R Murthy <arun.r.murthy@intel.com>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: Arun R Murthy <arun.r.murthy@intel.com>
Subject: Re: [PATCH] drm/xe/display: check for error on drmm_mutex_init
Date: Thu, 21 Mar 2024 11:43:31 +0200 [thread overview]
Message-ID: <87jzlvncn0.fsf@intel.com> (raw)
In-Reply-To: <20240321060124.4074773-1-arun.r.murthy@intel.com>
On Thu, 21 Mar 2024, Arun R Murthy <arun.r.murthy@intel.com> wrote:
> Check return value for drmm_mutex_init as it can fail and return on
> failure.
>
> Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
> ---
> drivers/gpu/drm/xe/display/xe_display.c | 14 ++++++++------
> 1 file changed, 8 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..ac2e58d1fa82 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -107,12 +107,14 @@ 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);
> + if ((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)))
Excessive parentheses.
BR,
Jani.
> + return -ENOMEM;
> +
> xe->enabled_irq_mask = ~0;
>
> err = drmm_add_action_or_reset(&xe->drm, display_destroy, NULL);
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-03-21 9:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 6:01 [PATCH] drm/xe/display: check for error on drmm_mutex_init Arun R Murthy
2024-03-21 6:47 ` ✓ CI.Patch_applied: success for drm/xe/display: check for error on drmm_mutex_init (rev2) Patchwork
2024-03-21 6:48 ` ✓ CI.checkpatch: " Patchwork
2024-03-21 6:49 ` ✓ CI.KUnit: " Patchwork
2024-03-21 7:00 ` ✓ CI.Build: " Patchwork
2024-03-21 7:03 ` ✓ CI.Hooks: " Patchwork
2024-03-21 7:04 ` ✓ CI.checksparse: " Patchwork
2024-03-21 7:35 ` ✓ CI.BAT: " Patchwork
2024-03-21 9:43 ` Jani Nikula [this message]
2024-03-22 20:51 ` [PATCH] drm/xe/display: check for error on drmm_mutex_init Lucas De Marchi
-- strict thread matches above, loose matches on Subject: below --
2024-03-19 3:03 Arun R Murthy
2024-03-20 0:35 ` Lucas De Marchi
2024-03-21 5:04 ` Murthy, Arun R
2024-03-21 5:43 ` Lucas De Marchi
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=87jzlvncn0.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=arun.r.murthy@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--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