ARM: tegra: p852: Fix misbracketed cond clause
Andrew Chew [Wed, 31 Oct 2012 23:59:30 +0000 (16:59 -0700)]
This misbracketing can potentially result in an invalid pointer dereference.

Signed-off-by: Andrew Chew <achew@nvidia.com>
Change-Id: Iaed185dd2141f1aa332747eeba10d22b850caa37
Reviewed-on: http://git-master/r/168475
Reviewed-by: Peng Wu <pengw@nvidia.com>
Tested-by: Peng Wu <pengw@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Allen Martin <amartin@nvidia.com>
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

arch/arm/mach-tegra/p852/board-p852-power.c

index 949537e..e69f98c 100644 (file)
@@ -173,11 +173,12 @@ static void __init tps6586x_rtc_preinit(void)
                system_rev == P852_SKU5_C01) {
                for (i = 0; i < tps_platform.num_subdevs; ++i)
                        if (!strcmp(tps_platform.subdevs[i].name,
-                               "tps6586x-rtc"))
+                               "tps6586x-rtc")) {
                                rtc_pdata =
                                        (struct tps6586x_rtc_platform_data *)
                                        (tps_platform.subdevs[i].platform_data);
                                rtc_pdata->cl_sel = TPS6586X_RTC_CL_SEL_1_5PF;
+                       }
        }
 }