ARM: tegra: Check NULL pointer to avoid crash
Chao Xu [Mon, 3 Jun 2013 23:39:28 +0000 (16:39 -0700)]
This is just a workaround. Ideally any access of the tegra_dc_feature_xxx
function needs to check if the window exists.

Change-Id: Ib15e618412e03038b08579b57aef1ff32592b6d8
Signed-off-by: Chao Xu <cxu@nvidia.com>
Reviewed-on: http://git-master/r/242516

drivers/video/tegra/dc/dc_config.c

index 5a1224e..3d831c8 100644 (file)
@@ -501,7 +501,7 @@ int tegra_dc_feature_is_gen2_blender(struct tegra_dc *dc, int win_idx)
 {
        long *addr = tegra_dc_parse_feature(dc, win_idx, HAS_GEN2_BLEND);
 
-       if (addr[BLEND_GENERATION] == 2)
+       if (addr && addr[BLEND_GENERATION] == 2)
                return 1;
 
        return 0;