Skip to content

Commit

Permalink
staging: drm/omap: Validate debugfs device
Browse files Browse the repository at this point in the history
Added check for valid device information before dumping debugfs
information.

Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Andy Gross authored and Greg Kroah-Hartman committed Mar 7, 2012
1 parent 132390c commit 02646fb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/staging/omapdrm/omap_dmm_tiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,18 @@ int tiler_map_show(struct seq_file *s, void *arg)
const char *a2d = special;
const char *m2dp = m2d, *a2dp = a2d;
char nice[128];
int h_adj = omap_dmm->lut_height / ydiv;
int w_adj = omap_dmm->lut_width / xdiv;
int h_adj;
int w_adj;
unsigned long flags;

if (!omap_dmm) {
/* early return if dmm/tiler device is not initialized */
return 0;
}

h_adj = omap_dmm->lut_height / ydiv;
w_adj = omap_dmm->lut_width / xdiv;

map = kzalloc(h_adj * sizeof(*map), GFP_KERNEL);
global_map = kzalloc((w_adj + 1) * h_adj, GFP_KERNEL);

Expand Down

0 comments on commit 02646fb

Please sign in to comment.