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 <dan.carpenter@oracle.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
Dan Carpenter 2015-01-28 09:43:35 +03:00 committed by Thierry Reding
parent 6edb2442c0
commit 944579c5a4

View File

@ -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;
}