Commit 02646fb8 authored by Andy Gross's avatar Andy Gross Committed by Greg Kroah-Hartman

staging: drm/omap: Validate debugfs device

Added check for valid device information before dumping debugfs
information.
Signed-off-by: default avatarAndy Gross <andy.gross@ti.com>
Signed-off-by: default avatarRob Clark <rob@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 132390c7
...@@ -766,10 +766,18 @@ int tiler_map_show(struct seq_file *s, void *arg) ...@@ -766,10 +766,18 @@ int tiler_map_show(struct seq_file *s, void *arg)
const char *a2d = special; const char *a2d = special;
const char *m2dp = m2d, *a2dp = a2d; const char *m2dp = m2d, *a2dp = a2d;
char nice[128]; char nice[128];
int h_adj = omap_dmm->lut_height / ydiv; int h_adj;
int w_adj = omap_dmm->lut_width / xdiv; int w_adj;
unsigned long flags; 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); map = kzalloc(h_adj * sizeof(*map), GFP_KERNEL);
global_map = kzalloc((w_adj + 1) * h_adj, GFP_KERNEL); global_map = kzalloc((w_adj + 1) * h_adj, GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment