drm: make drm_get_format_name thread-safe
Signed-off-by: Eric Engestrom <eric@engestrom.ch> [danvet: Clarify that the returned pointer must be freed with kfree().] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:

committed by
Daniel Vetter

parent
fc93ff608b
commit
90844f0004
@@ -1154,6 +1154,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
|
||||
u32 tmp, viewport_w, viewport_h;
|
||||
int r;
|
||||
bool bypass_lut = false;
|
||||
const char *format_name;
|
||||
|
||||
/* no fb bound */
|
||||
if (!atomic && !crtc->primary->fb) {
|
||||
@@ -1257,8 +1258,9 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
|
||||
bypass_lut = true;
|
||||
break;
|
||||
default:
|
||||
DRM_ERROR("Unsupported screen format %s\n",
|
||||
drm_get_format_name(target_fb->pixel_format));
|
||||
format_name = drm_get_format_name(target_fb->pixel_format);
|
||||
DRM_ERROR("Unsupported screen format %s\n", format_name);
|
||||
kfree(format_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -1469,6 +1471,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
|
||||
u32 viewport_w, viewport_h;
|
||||
int r;
|
||||
bool bypass_lut = false;
|
||||
const char *format_name;
|
||||
|
||||
/* no fb bound */
|
||||
if (!atomic && !crtc->primary->fb) {
|
||||
@@ -1558,8 +1561,9 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
|
||||
bypass_lut = true;
|
||||
break;
|
||||
default:
|
||||
DRM_ERROR("Unsupported screen format %s\n",
|
||||
drm_get_format_name(target_fb->pixel_format));
|
||||
format_name = drm_get_format_name(target_fb->pixel_format);
|
||||
DRM_ERROR("Unsupported screen format %s\n", format_name);
|
||||
kfree(format_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user