From 14212fe77ef6f9b0ec61f9ad946dea90a22496ec Mon Sep 17 00:00:00 2001 From: Bernard Zhao Date: Fri, 14 Aug 2020 01:30:19 -0700 Subject: [PATCH] drm/via: reduce no need mutex_lock area In function via_mem_alloc`s error branch, DRM_ERROR is protected in the mutex_lock(&dev->struct_mutex) area. >From the code, we see that DRM_ERROR is just an error log print without any struct element, there is no need to protect this. Signed-off-by: Bernard Zhao Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200814083021.8962-1-bernard@vivo.com --- drivers/gpu/drm/via/via_mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/via/via_mm.c b/drivers/gpu/drm/via/via_mm.c index 45cc9e9..dae1bac 100644 --- a/drivers/gpu/drm/via/via_mm.c +++ b/drivers/gpu/drm/via/via_mm.c @@ -129,9 +129,9 @@ int via_mem_alloc(struct drm_device *dev, void *data, mutex_lock(&dev->struct_mutex); if (0 == ((mem->type == VIA_MEM_VIDEO) ? dev_priv->vram_initialized : dev_priv->agp_initialized)) { + mutex_unlock(&dev->struct_mutex); DRM_ERROR ("Attempt to allocate from uninitialized memory manager.\n"); - mutex_unlock(&dev->struct_mutex); return -EINVAL; } -- 2.7.4