drm/nouveau/bios: memset dcb struct to zero before parsing
authorBen Skeggs <bskeggs@redhat.com>
Mon, 8 Sep 2014 00:33:32 +0000 (10:33 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 15 Sep 2014 12:25:08 +0000 (22:25 +1000)
Fixes type/mask calculation being based on uninitialised data for VGA
outputs.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c

index 88606bfaf84742c3c87a26d0d8387c29fecc9d81..bd8d348385b38fe1a3231586bdea941be9657558 100644 (file)
@@ -124,6 +124,7 @@ dcb_outp_parse(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len,
               struct dcb_output *outp)
 {
        u16 dcb = dcb_outp(bios, idx, ver, len);
+       memset(outp, 0x00, sizeof(*outp));
        if (dcb) {
                if (*ver >= 0x20) {
                        u32 conn = nv_ro32(bios, dcb + 0x00);