DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
commitc245cb9e15055ed5dcf7eaf29232badb0059fdc1
authorMichael Witten <mfwitten@gmail.com>
Fri, 16 Sep 2011 20:45:30 +0000 (16 20:45 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 10 Oct 2011 08:04:57 +0000 (10 09:04 +0100)
treeab8142c8cf4bb3bf43b1086c4eba24885ff409af
parentd0d0a225e6ad43314c9aa7ea081f76adc5098ad4
DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}

The value of RADEON_DEBUGFS_MAX_NUM_FILES has been used to
specify the size of an array, each element of which looks
like this:

  struct radeon_debugfs {
          struct drm_info_list    *files;
          unsigned                num_files;
  };

Consequently, the number of debugfs files may be much greater
than RADEON_DEBUGFS_MAX_NUM_FILES, something that the current
code ignores:

  if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
          DRM_ERROR("Reached maximum number of debugfs files.\n");
          DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
          return -EINVAL;
  }

This commit fixes this make, and accordingly renames:

  RADEON_DEBUGFS_MAX_NUM_FILES

to:

  RADEON_DEBUGFS_MAX_COMPONENTS

Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_device.c