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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Nov 2014 16:47:56 +0000 (08:47 -0800)
commit 595d373f1e9c9ce0fc946457fdb488e8a58972cd upstream.

Fixes type/mask calculation being based on uninitialised data for VGA
outputs.

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

index 2d9b9d7a7992111cc1d4bd0ff3e60254bf52dcb5..f3edd2841f2df42a38db7d13c63c71d5bb122658 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);