From: Dan Carpenter Date: Wed, 28 Jan 2015 06:43:35 +0000 (+0300) Subject: drm: Check the right variable when setting formats X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=944579c5a474e5faffd3ff2ee0e45eb7c53c3fd3;p=openwrt%2Fstaging%2Fblogic.git drm: Check the right variable when setting formats When setting the video bus supported formats for a display device using drm_display_info_set_bus_formats(), check for the proper variable after duplicating memory. Signed-off-by: Dan Carpenter Reviewed-by: Daniel Kurtz Signed-off-by: Thierry Reding --- diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 0e4ec700b0a6..6b00173d1be4 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -787,7 +787,7 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info, if (formats && num_formats) { fmts = kmemdup(formats, sizeof(*formats) * num_formats, GFP_KERNEL); - if (!formats) + if (!fmts) return -ENOMEM; }