msm: Fix possible string overflows and uninitialized variable
Change-Id: I6cf23e910c6929f9af75aa9011057da8d998288d
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
diff --git a/arch/arm/mach-msm/pm-8x60.c b/arch/arm/mach-msm/pm-8x60.c
index 6a78597..ad6da6a 100644
--- a/arch/arm/mach-msm/pm-8x60.c
+++ b/arch/arm/mach-msm/pm-8x60.c
@@ -162,7 +162,7 @@
}
if (ret > 0) {
- strcat(buf, "\n");
+ strlcat(buf, "\n", PAGE_SIZE);
ret++;
}
@@ -216,7 +216,7 @@
{
char cpu_name[8];
struct kobject *cpu_kobj;
- struct msm_pm_sysfs_sleep_mode *mode;
+ struct msm_pm_sysfs_sleep_mode *mode = NULL;
int i, j, k;
int ret;