aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDariusz Szymczak <dariusz.xd.szymczak@stericsson.com>2010-06-18 16:19:49 +0200
committerJohn Rigby <john.rigby@linaro.org>2010-09-02 22:45:47 -0600
commit6875d3d22c455ce42aa86be66f1c196bb0e570de (patch)
treed4aa2cdebbde04869afb1ceab5f1f9327955d089
parentf8a8a208e6ee66db57bae4566fadb09467ad716d (diff)
downloadlinux-2.6.34-ux500-6875d3d22c455ce42aa86be66f1c196bb0e570de.tar.gz
ste_conn_driver: Fix crash if no patch file found
If no patch file has been found for the connected chip the device struct is freed by calling ste_conn_reset(). Then the ste_conn_register() will try to free the same struct again which will cause a kernel crash. There is no need to do a reset of the whole driver when the chip startup has failed, it's enough to call the cpd_chip_shutdown() instead of ste_conn_reset() and let the ste_conn_register() free the dev struct. ST-Ericsson ID: ER264360 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/1750 Reviewed-by: Magnus MALMBORN <magnus.malmborn@stericsson.com> Reviewed-by: Dariusz SZYMCZAK <dariusz.xd.szymczak@stericsson.com> Tested-by: Dariusz SZYMCZAK <dariusz.xd.szymczak@stericsson.com> Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com> Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Change-Id: I9dfdefd435d3e7b6f35f0a9a613a4b879f22bd41 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/2630
-rw-r--r--drivers/mfd/ste_conn/ste_conn_cpd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mfd/ste_conn/ste_conn_cpd.c b/drivers/mfd/ste_conn/ste_conn_cpd.c
index c675677e51f..759410cbd8d 100644
--- a/drivers/mfd/ste_conn/ste_conn_cpd.c
+++ b/drivers/mfd/ste_conn/ste_conn_cpd.c
@@ -784,12 +784,14 @@ int ste_conn_cpd_chip_startup_finished(int err)
STE_CONN_INFO("ste_conn_cpd_chip_startup_finished (%d)", err);
if (err) {
- ste_conn_reset(NULL);
+ /* Shutdown the chip */
+ cpd_chip_shutdown();
} else {
CPD_SET_MAIN_STATE(CPD_STATE_ACTIVE);
- wake_up_interruptible(&ste_conn_cpd_wait_queue);
}
+ wake_up_interruptible(&ste_conn_cpd_wait_queue);
+
return ret_val;
}
EXPORT_SYMBOL(ste_conn_cpd_chip_startup_finished);