Skip to contentSkip to conversation

drm/bridge: checking the wrong variable

PATCH In review Dan Carpenter 3 participants 3 messages Jan 28, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: checking the wrong variable

We were supposed to check "fmts" here instead of "formats". I suppose it eventually leads to a NULL dereference.

drivers/gpu/drm/drm_crtc.c +1 -1
index 98fb640..8ae239f 100644
@@ -783,7 +783,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;
 	}
 
Reviewed-by on v1 1/1
#1 lore raw

Hi Dan,

nit: this patch is not really for "drm/bridge".

Quoted 6 lines · Dan Carpenter

We were supposed to check "fmts" here instead of "formats". I suppose it eventually leads to a NULL dereference.

Otherwise, good catch!

Quoted 18 lines
drivers/gpu/drm/drm_crtc.c +1 -1
index 98fb640..8ae239f 100644
@@ -783,7 +783,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;
        }
 

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 9 lines · Daniel Kurtz

Hi Dan,

nit: this patch is not really for "drm/bridge".

Quoted 4 lines · Dan Carpenter

We were supposed to check "fmts" here instead of "formats". I suppose it eventually leads to a NULL dereference.

Quoted 6 lines
Quoted 2 lines

Otherwise, good catch!

I've reworded the commit message slightly and applied this. Thanks.

Thierry