Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a441dbb1 authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ben Skeggs
Browse files

drm/nouveau: use kmemdup for edid allocation/copying



Avoids potential null pointer dereference.

Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 03e9a040
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -399,8 +399,9 @@ nouveau_connector_detect_lvds(struct drm_connector *connector, bool force)
		struct edid *edid =
			(struct edid *)nouveau_bios_embedded_edid(dev);
		if (edid) {
			nv_connector->edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
			*(nv_connector->edid) = *edid;
			nv_connector->edid =
					kmemdup(edid, EDID_LENGTH, GFP_KERNEL);
			if (nv_connector->edid)
				status = connector_status_connected;
		}
	}