Explorar o código

drm/i915/bios: Prevent NULL dereference after allocation failure

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson %!s(int64=14) %!d(string=hai) anos
pai
achega
6edc3242e3
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      drivers/gpu/drm/i915/intel_bios.c

+ 2 - 0
drivers/gpu/drm/i915/intel_bios.c

@@ -169,6 +169,8 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
 			((unsigned char *)entry + dvo_timing_offset);
 
 	panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
+	if (!panel_fixed_mode)
+		return;
 
 	fill_detail_timing_data(panel_fixed_mode, dvo_timing);