arm: tegra: fix powergate null ptr exception
Adeel Raza [Tue, 9 Apr 2013 08:47:57 +0000 (01:47 -0700)]
Change-Id: Ic86d3fa60ed47732671531321d3f7b9367673719
Signed-off-by: Adeel Raza <araza@nvidia.com>
Reviewed-on: http://git-master/r/217765
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Ken Adams <kadams@nvidia.com>
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>

arch/arm/mach-tegra/powergate.c

index ae36b29..1e79489 100644 (file)
@@ -568,7 +568,7 @@ EXPORT_SYMBOL(tegra_powergate_get_name);
 
 int tegra_powergate_init_refcount(void)
 {
-       if (!pg_ops->powergate_init_refcount)
+       if ((!pg_ops) || (!pg_ops->powergate_init_refcount))
                return 0;
 
        return pg_ops->powergate_init_refcount();