aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/omapdrm
diff options
context:
space:
mode:
authorAndy Gross <andy.gross@ti.com>2012-03-05 11:48:38 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-07 16:38:07 -0500
commit02646fb8b3de95a170f8ac4f0773a4f5e2a1b54c (patch)
tree07c6c654e77ba9e3d3932ed46da416de6c542912 /drivers/staging/omapdrm
parent132390c79e01b3da732bc7b5d9e729b52086ceb6 (diff)
staging: drm/omap: Validate debugfs device
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>
Diffstat (limited to 'drivers/staging/omapdrm')
-rw-r--r--drivers/staging/omapdrm/omap_dmm_tiler.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/staging/omapdrm/omap_dmm_tiler.c b/drivers/staging/omapdrm/omap_dmm_tiler.c
index 852d9440f72..e4c7bb6afce 100644
--- a/drivers/staging/omapdrm/omap_dmm_tiler.c
+++ b/drivers/staging/omapdrm/omap_dmm_tiler.c
@@ -766,10 +766,18 @@ int tiler_map_show(struct seq_file *s, void *arg)
766 const char *a2d = special; 766 const char *a2d = special;
767 const char *m2dp = m2d, *a2dp = a2d; 767 const char *m2dp = m2d, *a2dp = a2d;
768 char nice[128]; 768 char nice[128];
769 int h_adj = omap_dmm->lut_height / ydiv; 769 int h_adj;
770 int w_adj = omap_dmm->lut_width / xdiv; 770 int w_adj;
771 unsigned long flags; 771 unsigned long flags;
772 772
773 if (!omap_dmm) {
774 /* early return if dmm/tiler device is not initialized */
775 return 0;
776 }
777
778 h_adj = omap_dmm->lut_height / ydiv;
779 w_adj = omap_dmm->lut_width / xdiv;
780
773 map = kzalloc(h_adj * sizeof(*map), GFP_KERNEL); 781 map = kzalloc(h_adj * sizeof(*map), GFP_KERNEL);
774 global_map = kzalloc((w_adj + 1) * h_adj, GFP_KERNEL); 782 global_map = kzalloc((w_adj + 1) * h_adj, GFP_KERNEL);
775 783