From caafece2b452cbcb7f41672a3b4b76d64392e6da Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Mon, 27 Jun 2011 22:59:17 +0200 Subject: fix segfault when no clock is available When there is no clock available, we even register the display ops. The 'enter' callbakc is set but not data is available int the row private data which leads to a segfaults. This patch fix this problem by not registering the ops if the pm subsystem was not correctly initialized. In the meantime, we have to erase the window when we are switching from one window to another. We can say it is the "default" display callback. Signed-off-by: Daniel Lezcano Reported-by: Milo (Woogyom) Kim --- clocks.c | 8 ++++---- display.c | 5 ++++- regulator.c | 8 ++++---- sensor.c | 8 ++++---- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/clocks.c b/clocks.c index 0bd0a0e..20a245c 100644 --- a/clocks.c +++ b/clocks.c @@ -405,9 +405,6 @@ int clock_init(void) { char clk_dir_path[PATH_MAX]; - if (display_register(CLOCK, &clock_ops)) - return -1; - if (locate_debugfs(clk_dir_path)) return -1; @@ -420,5 +417,8 @@ int clock_init(void) if (!clock_tree) return -1; - return fill_clock_tree(); + if (fill_clock_tree()) + return -1; + + return display_register(CLOCK, &clock_ops); } diff --git a/display.c b/display.c index 0cfbf94..ebc4de6 100644 --- a/display.c +++ b/display.c @@ -120,7 +120,10 @@ static int display_refresh(int win, bool read) if (windata[win].ops && windata[win].ops->display) return windata[win].ops->display(read); - return 0; + if (werase(main_win)) + return -1; + + return wrefresh(main_win); } int display_refresh_pad(int win) diff --git a/regulator.c b/regulator.c index 849f906..e9b01bb 100644 --- a/regulator.c +++ b/regulator.c @@ -236,12 +236,12 @@ static struct display_ops regulator_ops = { int regulator_init(void) { - if (display_register(REGULATOR, ®ulator_ops)) - return -1; - reg_tree = tree_load(SYSFS_REGULATOR, regulator_filter_cb); if (!reg_tree) return -1; - return fill_regulator_tree(); + if (fill_regulator_tree()) + return -1; + + return display_register(REGULATOR, ®ulator_ops); } diff --git a/sensor.c b/sensor.c index d63510e..e172f88 100644 --- a/sensor.c +++ b/sensor.c @@ -271,12 +271,12 @@ static struct display_ops sensor_ops = { int sensor_init(void) { - if (display_register(SENSOR, &sensor_ops)) - return -1; - sensor_tree = tree_load(SYSFS_SENSOR, sensor_filter_cb); if (!sensor_tree) return -1; - return fill_sensor_tree(); + if (fill_sensor_tree()) + return -1; + + return display_register(SENSOR, &sensor_ops); } -- cgit v1.2.3 From 856efcd3eb3b2ac0c0742aa115054cdffb4c4bf2 Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Mon, 25 Jul 2011 23:08:54 +0200 Subject: Version 0.5.1 * Fixed segfault when no clock is available. Signed-off-by: Daniel Lezcano --- powerdebug.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/powerdebug.h b/powerdebug.h index 01b22ba..05d919b 100644 --- a/powerdebug.h +++ b/powerdebug.h @@ -13,6 +13,4 @@ * - initial API and implementation *******************************************************************************/ -#define VERSION "0.5.0" - - +#define VERSION "0.5.1" -- cgit v1.2.3 From 29d28cd500fa0fccdcfc92a96e20c18af9ccfb5c Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Mon, 25 Jul 2011 23:27:01 +0200 Subject: Version 0.5.1 - fixed https://bugs.launchpad.net/linaro-powerdebug/+bug/802387 Signed-off-by: Daniel Lezcano --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3a86e16..b5818a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +powerdebug (0.5-2011.07-0) natty; urgency=low + + * fixed lp: 802387 + + -- Daniel Lezcano Mon, 25 Jul 2011 23:25:05 +0200 + powerdebug (0.5-2011.06-0) natty; urgency=low * added tree algorithm -- cgit v1.2.3