mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-20 17:44:33 +08:00
drm/nouveau: use kmemdup for edid allocation/copying
Avoids potential null pointer dereference. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
03e9a04050
commit
a441dbb1d6
@ -399,9 +399,10 @@ 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;
|
||||
status = connector_status_connected;
|
||||
nv_connector->edid =
|
||||
kmemdup(edid, EDID_LENGTH, GFP_KERNEL);
|
||||
if (nv_connector->edid)
|
||||
status = connector_status_connected;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user