Commit 72de1823 authored by Ilia Mirkin's avatar Ilia Mirkin Committed by Linus Torvalds
Browse files

drm/nouveau/mxm: fix null deref on load

Since commit 61b365a5 ("drm/nouveau: populate master subdev pointer
only when fully constructed"), the nouveau_mxm(bios) call will return
NULL, since it's still being called from the constructor.  Instead, pass
the mxm pointer via the unused data field.


Reported-by: default avatarAndreas Reis <>
Tested-by: default avatarAndreas Reis <>
Signed-off-by: default avatarIlia Mirkin <>
Cc: Ben Skeggs <>
Cc: Dave Airlie <>
Signed-off-by: default avatarLinus Torvalds <>
parent 4d935402
......@@ -100,7 +100,7 @@ mxm_match_dcb(struct nouveau_mxm *mxm, u8 *data, void *info)
static int
mxm_dcb_sanitise_entry(struct nouveau_bios *bios, void *data, int idx, u16 pdcb)
struct nouveau_mxm *mxm = nouveau_mxm(bios);
struct nouveau_mxm *mxm = data;
struct context ctx = { .outp = (u32 *)(bios->data + pdcb) };
u8 type, i2cidx, link, ver, len;
u8 *conn;
......@@ -199,7 +199,7 @@ mxm_dcb_sanitise(struct nouveau_mxm *mxm)
dcb_outp_foreach(bios, NULL, mxm_dcb_sanitise_entry);
dcb_outp_foreach(bios, mxm, mxm_dcb_sanitise_entry);
mxms_foreach(mxm, 0x01, mxm_show_unmatched, NULL);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment