drm/radeon: fix handling of variable sized arrays for router objects
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 27 Aug 2013 16:36:01 +0000 (12:36 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 26 Oct 2013 20:06:01 +0000 (21:06 +0100)
commit1c12047d733f77e59d0fa3a2f3d70582717d10ba
treebbba37da34253f9bd299db7560c1d424e43bd026
parentf46575554ac083111a3df50ddcd66e62973b49fe
drm/radeon: fix handling of variable sized arrays for router objects

commit fb93df1c2d8b3b1fb16d6ee9e32554e0c038815d upstream.

The table has the following format:

typedef struct _ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT         //usSrcDstTableOffset pointing to this structure
{
  UCHAR               ucNumberOfSrc;
  USHORT              usSrcObjectID[1];
  UCHAR               ucNumberOfDst;
  USHORT              usDstObjectID[1];
}ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT;

usSrcObjectID[] and usDstObjectID[] are variably sized, so we
can't access them directly.  Use pointers and update the offset
appropriately when accessing the Dst members.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/gpu/drm/radeon/radeon_atombios.c