Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/nouveau/mxm: fix null deref on load

Since commit 61b365a505d6 ("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.

See https://bugs.freedesktop.org/show_bug.cgi?id=73791

Reported-by: Andreas Reis <andreas.reis@gmail.com>
Tested-by: Andreas Reis <andreas.reis@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Ilia Mirkin and committed by
Linus Torvalds
72de1823 4d935402

+2 -2
+2 -2
drivers/gpu/drm/nouveau/core/subdev/mxm/nv50.c
··· 100 100 static int 101 101 mxm_dcb_sanitise_entry(struct nouveau_bios *bios, void *data, int idx, u16 pdcb) 102 102 { 103 - struct nouveau_mxm *mxm = nouveau_mxm(bios); 103 + struct nouveau_mxm *mxm = data; 104 104 struct context ctx = { .outp = (u32 *)(bios->data + pdcb) }; 105 105 u8 type, i2cidx, link, ver, len; 106 106 u8 *conn; ··· 199 199 return; 200 200 } 201 201 202 - dcb_outp_foreach(bios, NULL, mxm_dcb_sanitise_entry); 202 + dcb_outp_foreach(bios, mxm, mxm_dcb_sanitise_entry); 203 203 mxms_foreach(mxm, 0x01, mxm_show_unmatched, NULL); 204 204 } 205 205