drm: Check the right variable when setting formats
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 28 Jan 2015 06:43:35 +0000 (09:43 +0300)
committerThierry Reding <treding@nvidia.com>
Wed, 28 Jan 2015 07:58:37 +0000 (08:58 +0100)
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>
drivers/gpu/drm/drm_crtc.c

index 0e4ec700b0a66b3345405078913032269eb29f8e..6b00173d1be4fd6c96f749a803dd23ab5495de88 100644 (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;
        }