summaryrefslogtreecommitdiffstats
path: root/drivers/staging/omapdrm
diff options
context:
space:
mode:
authorAndy Gross <andy.gross@ti.com>2012-03-05 10:48:38 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-07 13:38:07 -0800
commit02646fb8b3de95a170f8ac4f0773a4f5e2a1b54c (patch)
tree07c6c654e77ba9e3d3932ed46da416de6c542912 /drivers/staging/omapdrm
parent132390c79e01b3da732bc7b5d9e729b52086ceb6 (diff)
downloadlinux-02646fb8b3de95a170f8ac4f0773a4f5e2a1b54c.tar.gz
linux-02646fb8b3de95a170f8ac4f0773a4f5e2a1b54c.tar.bz2
linux-02646fb8b3de95a170f8ac4f0773a4f5e2a1b54c.zip
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 852d9440f725..e4c7bb6afce4 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)
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);