All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sim: change pin_retries array to unsigned char
@ 2014-11-28 14:34 Cedric Jehasse
  2014-12-03 23:38 ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: Cedric Jehasse @ 2014-11-28 14:34 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 9507 bytes --]

From: Cedric Jehasse <cedric.jehasse@softathome.com>

Had a problem on mips, the Retries dict in org.ofono.SimManager was 0
for all pin-types.
The problem is int* are passed to dbus-functions, while the type is
DBUS_TYPE_BYTE. Changed the type of pin_retries throughout the code to
match the byte type.
---
 drivers/atmodem/sim.c         | 24 ++++++++++++------------
 drivers/isimodem/uicc.c       |  2 +-
 drivers/qmimodem/sim-legacy.c |  2 +-
 drivers/qmimodem/sim.c        |  2 +-
 include/sim.h                 |  2 +-
 src/sim.c                     | 13 +++++++------
 6 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index c128e33..0f64602 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -479,7 +479,7 @@ static struct {
 
 #define BUILD_PIN_RETRIES_ARRAY(passwd_types, passwd_types_cnt, retry)	\
 	for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)		\
-		retry[i] = -1;						\
+		retry[i] = 0xff;					\
 									\
 	for (i = 0; i < passwd_types_cnt; i++) {			\
 		int val;						\
@@ -500,7 +500,7 @@ static void huawei_cpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *final = g_at_result_final_response(result);
 	GAtResultIter iter;
 	struct ofono_error error;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t i;
 	static enum ofono_sim_password_type password_types[] = {
 		OFONO_SIM_PASSWORD_SIM_PUK,
@@ -547,7 +547,7 @@ static void pinnum_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *final = g_at_result_final_response(result);
 	GAtResultIter iter;
 	struct ofono_error error;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t i;
 	static enum ofono_sim_password_type password_types[] = {
 		OFONO_SIM_PASSWORD_SIM_PIN,
@@ -587,7 +587,7 @@ static void zpinpuk_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *final = g_at_result_final_response(result);
 	GAtResultIter iter;
 	struct ofono_error error;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t i;
 	static enum ofono_sim_password_type password_types[] = {
 		OFONO_SIM_PASSWORD_SIM_PIN,
@@ -625,7 +625,7 @@ static void xpincnt_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *final = g_at_result_final_response(result);
 	GAtResultIter iter;
 	struct ofono_error error;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t i;
 	static enum ofono_sim_password_type password_types[] = {
 		OFONO_SIM_PASSWORD_SIM_PIN,
@@ -664,7 +664,7 @@ static void oercn_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *final = g_at_result_final_response(result);
 	GAtResultIter iter;
 	struct ofono_error error;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t i;
 	static enum ofono_sim_password_type password_types[] = {
 		OFONO_SIM_PASSWORD_SIM_PIN,
@@ -704,7 +704,7 @@ static void cpnnum_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *line;
 	int num;
 	char **entries;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t i;
 
 	decode_at_error(&error, final);
@@ -760,7 +760,7 @@ static void at_epin_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *final = g_at_result_final_response(result);
 	GAtResultIter iter;
 	struct ofono_error error;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t i;
 	static enum ofono_sim_password_type password_types[] = {
 		OFONO_SIM_PASSWORD_SIM_PIN,
@@ -798,7 +798,7 @@ static void at_cpinr_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	ofono_sim_pin_retries_cb_t cb = cbd->cb;
 	GAtResultIter iter;
 	struct ofono_error error;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t len = sizeof(at_sim_name) / sizeof(*at_sim_name);
 	size_t i;
 
@@ -843,7 +843,7 @@ static void at_spic_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *final = g_at_result_final_response(result);
 	GAtResultIter iter;
 	struct ofono_error error;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t i;
 	static enum ofono_sim_password_type password_types[] = {
 		OFONO_SIM_PASSWORD_SIM_PIN,
@@ -887,7 +887,7 @@ static void at_pct_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *final = g_at_result_final_response(result);
 	GAtResultIter iter;
 	struct ofono_error error;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t i;
 	enum ofono_sim_password_type pin_type;
 
@@ -939,7 +939,7 @@ static void at_pnnm_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	const char *final = g_at_result_final_response(result);
 	GAtResultIter iter;
 	struct ofono_error error;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	size_t i;
 	static enum ofono_sim_password_type password_types[] = {
 		OFONO_SIM_PASSWORD_SIM_PIN,
diff --git a/drivers/isimodem/uicc.c b/drivers/isimodem/uicc.c
index 0a5121d..a075d27 100644
--- a/drivers/isimodem/uicc.c
+++ b/drivers/isimodem/uicc.c
@@ -926,7 +926,7 @@ static void uicc_query_pin_retries_resp(const GIsiMessage *msg, void *opaque)
 {
 	struct isi_cb_data *cbd = opaque;
 	ofono_sim_pin_retries_cb_t cb = cbd->cb;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 	GIsiSubBlockIter iter;
 
 	uint8_t num_sb = 0;
diff --git a/drivers/qmimodem/sim-legacy.c b/drivers/qmimodem/sim-legacy.c
index 318b1ae..5b1bb5e 100644
--- a/drivers/qmimodem/sim-legacy.c
+++ b/drivers/qmimodem/sim-legacy.c
@@ -38,7 +38,7 @@
 
 struct sim_data {
 	struct qmi_service *dms;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 };
 
 static void qmi_read_file_info(struct ofono_sim *sim, int fileid,
diff --git a/drivers/qmimodem/sim.c b/drivers/qmimodem/sim.c
index 197da50..f7ccd06 100644
--- a/drivers/qmimodem/sim.c
+++ b/drivers/qmimodem/sim.c
@@ -44,7 +44,7 @@ struct sim_data {
 	uint8_t card_state;
 	uint8_t app_type;
 	uint8_t passwd_state;
-	int retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char retries[OFONO_SIM_PASSWORD_INVALID];
 };
 
 static int create_fileid_data(uint8_t app_type, int fileid,
diff --git a/include/sim.h b/include/sim.h
index ed850f9..f66bb93 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -113,7 +113,7 @@ typedef void (*ofono_sim_passwd_cb_t)(const struct ofono_error *error,
 					void *data);
 
 typedef void (*ofono_sim_pin_retries_cb_t)(const struct ofono_error *error,
-			int retries[OFONO_SIM_PASSWORD_INVALID], void *data);
+			unsigned char retries[OFONO_SIM_PASSWORD_INVALID], void *data);
 
 typedef void (*ofono_sim_lock_unlock_cb_t)(const struct ofono_error *error,
 					void *data);
diff --git a/src/sim.c b/src/sim.c
index edae5eb..fe871a0 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -62,7 +62,7 @@ struct ofono_sim {
 	enum ofono_sim_password_type pin_type;
 	gboolean locked_pins[OFONO_SIM_PASSWORD_SIM_PUK]; /* Number of PINs */
 
-	int pin_retries[OFONO_SIM_PASSWORD_INVALID];
+	unsigned char pin_retries[OFONO_SIM_PASSWORD_INVALID];
 
 	enum ofono_sim_phase phase;
 	unsigned char mnc_length;
@@ -273,7 +273,7 @@ static void **get_pin_retries(struct ofono_sim *sim)
 	void **ret;
 
 	for (i = 1, nelem = 0; i < OFONO_SIM_PASSWORD_INVALID; i++) {
-		if (sim->pin_retries[i] == -1)
+		if (sim->pin_retries[i] == 0xff)
 			continue;
 
 		nelem += 1;
@@ -282,7 +282,7 @@ static void **get_pin_retries(struct ofono_sim *sim)
 	ret = g_new0(void *, nelem * 2 + 1);
 
 	for (i = 1, nelem = 0; i < OFONO_SIM_PASSWORD_INVALID; i++) {
-		if (sim->pin_retries[i] == -1)
+		if (sim->pin_retries[i] == 0xff)
 			continue;
 
 		ret[nelem++] = (void *) sim_passwd_name(i);
@@ -431,7 +431,7 @@ done:
 }
 
 static void sim_pin_retries_query_cb(const struct ofono_error *error,
-					int retries[OFONO_SIM_PASSWORD_INVALID],
+					unsigned char retries[OFONO_SIM_PASSWORD_INVALID],
 					void *data)
 {
 	struct ofono_sim *sim = data;
@@ -450,6 +450,7 @@ static void sim_pin_retries_query_cb(const struct ofono_error *error,
 	memcpy(sim->pin_retries, retries, sizeof(sim->pin_retries));
 
 	pin_retries = get_pin_retries(sim);
+
 	ofono_dbus_signal_dict_property_changed(conn, path,
 					OFONO_SIM_MANAGER_INTERFACE, "Retries",
 					DBUS_TYPE_BYTE,	&pin_retries);
@@ -2372,7 +2373,7 @@ static void sim_free_main_state(struct ofono_sim *sim)
 	int i;
 
 	for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)
-		sim->pin_retries[i] = -1;
+		sim->pin_retries[i] = 0xff;
 
 	memset(sim->locked_pins, 0, sizeof(sim->locked_pins));
 
@@ -2881,7 +2882,7 @@ struct ofono_sim *ofono_sim_create(struct ofono_modem *modem,
 						sim_remove, sim);
 
 	for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)
-		sim->pin_retries[i] = -1;
+		sim->pin_retries[i] = 0xff;
 
 	for (l = g_drivers; l; l = l->next) {
 		const struct ofono_sim_driver *drv = l->data;
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sim: change pin_retries array to unsigned char
  2014-11-28 14:34 [PATCH] sim: change pin_retries array to unsigned char Cedric Jehasse
@ 2014-12-03 23:38 ` Denis Kenzior
  2014-12-04  9:55   ` Cedric Jehasse
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Kenzior @ 2014-12-03 23:38 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

Hi Cedric,

On 11/28/2014 08:34 AM, Cedric Jehasse wrote:
> From: Cedric Jehasse <cedric.jehasse@softathome.com>
>
> Had a problem on mips, the Retries dict in org.ofono.SimManager was 0
> for all pin-types.
> The problem is int* are passed to dbus-functions, while the type is
> DBUS_TYPE_BYTE. Changed the type of pin_retries throughout the code to
> match the byte type.
> ---
>   drivers/atmodem/sim.c         | 24 ++++++++++++------------
>   drivers/isimodem/uicc.c       |  2 +-
>   drivers/qmimodem/sim-legacy.c |  2 +-
>   drivers/qmimodem/sim.c        |  2 +-
>   include/sim.h                 |  2 +-
>   src/sim.c                     | 13 +++++++------
>   6 files changed, 23 insertions(+), 22 deletions(-)
>

I really rather not modify every single driver for this issue.  Besides, 
the actual problem is actually in the core.  We were being quite evil 
with how we created our dictionary entries.

Please try the following patch (attached) and tell me if it fixes this 
bug on your platform.

Regards,
-Denis

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-sim-Fix-pin-retries-bogus-values-on-some-arch-es.patch --]
[-- Type: text/x-patch, Size: 3871 bytes --]

>From 7359b0322d93f6a332000c1064258d299c533bc3 Mon Sep 17 00:00:00 2001
From: Denis Kenzior <denkenz@gmail.com>
Date: Wed, 3 Dec 2014 17:31:09 -0600
Subject: [PATCH] sim: Fix pin retries bogus values on some arch-es

On some architectures the SimManager.Retries property was getting bogus
values.  This is because we were sending an array which pointed to int
values instead of the expected unsigned char values.

This fix allocates a temporary array of unsigned chars to hold the
actual D-Bus values being sent.  Additionally, the dictionary array is
changed to point to the temporary unsigned char based values instead of
the raw 'int' based retry values.
---
 src/sim.c | 40 +++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/src/sim.c b/src/sim.c
index edae5eb..6e9baa9 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -267,10 +267,12 @@ static char **get_locked_pins(struct ofono_sim *sim)
 	return ret;
 }
 
-static void **get_pin_retries(struct ofono_sim *sim)
+static void get_pin_retries(struct ofono_sim *sim, void ***out_dict,
+				unsigned char **out_retries)
 {
 	int i, nelem;
-	void **ret;
+	void **dict;
+	unsigned char *retries;
 
 	for (i = 1, nelem = 0; i < OFONO_SIM_PASSWORD_INVALID; i++) {
 		if (sim->pin_retries[i] == -1)
@@ -279,17 +281,21 @@ static void **get_pin_retries(struct ofono_sim *sim)
 		nelem += 1;
 	}
 
-	ret = g_new0(void *, nelem * 2 + 1);
+	dict = g_new0(void *, nelem * 2 + 1);
+	retries = g_new0(unsigned char, nelem);
 
-	for (i = 1, nelem = 0; i < OFONO_SIM_PASSWORD_INVALID; i++) {
+	for (i = 1, nelem = 0; i < OFONO_SIM_PASSWORD_INVALID; i++, nelem++) {
 		if (sim->pin_retries[i] == -1)
 			continue;
 
-		ret[nelem++] = (void *) sim_passwd_name(i);
-		ret[nelem++] = &sim->pin_retries[i];
+		retries[nelem] = sim->pin_retries[i];
+
+		dict[nelem * 2] = (void *) sim_passwd_name(i);
+		dict[nelem * 2 + 1] = &retries[i];
 	}
 
-	return ret;
+	*out_dict = dict;
+	*out_retries = retries;
 }
 
 static char **get_service_numbers(GSList *service_numbers)
@@ -344,7 +350,8 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
 	char **service_numbers;
 	char **locked_pins;
 	const char *pin_name;
-	void **pin_retries;
+	void **pin_retries_dict;
+	unsigned char *dbus_retries;
 	dbus_bool_t present = sim->state != OFONO_SIM_STATE_NOT_PRESENT;
 	dbus_bool_t fdn;
 	dbus_bool_t bdn;
@@ -419,10 +426,11 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
 				DBUS_TYPE_STRING,
 				(void *) &pin_name);
 
-	pin_retries = get_pin_retries(sim);
+	get_pin_retries(sim, &pin_retries_dict, &dbus_retries);
 	ofono_dbus_dict_append_dict(&dict, "Retries", DBUS_TYPE_BYTE,
-								&pin_retries);
-	g_free(pin_retries);
+							&pin_retries_dict);
+	g_free(pin_retries_dict);
+	g_free(dbus_retries);
 
 done:
 	dbus_message_iter_close_container(&iter, &dict);
@@ -437,7 +445,8 @@ static void sim_pin_retries_query_cb(const struct ofono_error *error,
 	struct ofono_sim *sim = data;
 	DBusConnection *conn = ofono_dbus_get_connection();
 	const char *path = __ofono_atom_get_path(sim->atom);
-	void **pin_retries;
+	void **pin_retries_dict;
+	unsigned char *dbus_retries;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
 		ofono_error("Querying remaining pin retries failed");
@@ -449,11 +458,12 @@ static void sim_pin_retries_query_cb(const struct ofono_error *error,
 
 	memcpy(sim->pin_retries, retries, sizeof(sim->pin_retries));
 
-	pin_retries = get_pin_retries(sim);
+	get_pin_retries(sim, &pin_retries_dict, &dbus_retries);
 	ofono_dbus_signal_dict_property_changed(conn, path,
 					OFONO_SIM_MANAGER_INTERFACE, "Retries",
-					DBUS_TYPE_BYTE,	&pin_retries);
-	g_free(pin_retries);
+					DBUS_TYPE_BYTE,	&pin_retries_dict);
+	g_free(pin_retries_dict);
+	g_free(dbus_retries);
 }
 
 static void sim_pin_retries_check(struct ofono_sim *sim)
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sim: change pin_retries array to unsigned char
  2014-12-03 23:38 ` Denis Kenzior
@ 2014-12-04  9:55   ` Cedric Jehasse
  2014-12-04 15:00     ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: Cedric Jehasse @ 2014-12-04  9:55 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

Hi Denis,

> Please try the following patch (attached) and tell me if it fixes this bug
> on your platform.
This patch caused a segfault. Please have a look at the reworked patch
(attached).

Thanks,
Cedric

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-sim-Fix-pin-retries-bogus-values-on-some-arch-es.patch --]
[-- Type: text/x-patch, Size: 3812 bytes --]

From d69bf227fe736392b532992d57e58e7e6bb08f36 Mon Sep 17 00:00:00 2001
From: Denis Kenzior <denkenz@gmail.com>
Date: Wed, 3 Dec 2014 17:31:09 -0600
Subject: [PATCH] sim: Fix pin retries bogus values on some arch-es

On some architectures the SimManager.Retries property was getting bogus
values.  This is because we were sending an array which pointed to int
values instead of the expected unsigned char values.

This fix allocates a temporary array of unsigned chars to hold the
actual D-Bus values being sent.  Additionally, the dictionary array is
changed to point to the temporary unsigned char based values instead of
the raw 'int' based retry values.
---
 src/sim.c | 39 +++++++++++++++++++++++++--------------
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/src/sim.c b/src/sim.c
index edae5eb..82f7409 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -267,10 +267,12 @@ static char **get_locked_pins(struct ofono_sim *sim)
 	return ret;
 }
 
-static void **get_pin_retries(struct ofono_sim *sim)
+static void get_pin_retries(struct ofono_sim *sim, void ***out_dict,
+				unsigned char **out_retries)
 {
 	int i, nelem;
-	void **ret;
+	void **dict;
+	unsigned char *retries;
 
 	for (i = 1, nelem = 0; i < OFONO_SIM_PASSWORD_INVALID; i++) {
 		if (sim->pin_retries[i] == -1)
@@ -279,17 +281,22 @@ static void **get_pin_retries(struct ofono_sim *sim)
 		nelem += 1;
 	}
 
-	ret = g_new0(void *, nelem * 2 + 1);
+	dict = g_new0(void *, nelem * 2 + 1);
+	retries = g_new0(unsigned char, nelem);
 
 	for (i = 1, nelem = 0; i < OFONO_SIM_PASSWORD_INVALID; i++) {
 		if (sim->pin_retries[i] == -1)
 			continue;
 
-		ret[nelem++] = (void *) sim_passwd_name(i);
-		ret[nelem++] = &sim->pin_retries[i];
+		retries[nelem] = sim->pin_retries[i];
+
+		dict[nelem * 2] = (void *) sim_passwd_name(i);
+		dict[nelem * 2 + 1] = &retries[nelem];
+		nelem++;
 	}
 
-	return ret;
+	*out_dict = dict;
+	*out_retries = retries;
 }
 
 static char **get_service_numbers(GSList *service_numbers)
@@ -344,7 +351,8 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
 	char **service_numbers;
 	char **locked_pins;
 	const char *pin_name;
-	void **pin_retries;
+	void **pin_retries_dict;
+	unsigned char *dbus_retries;
 	dbus_bool_t present = sim->state != OFONO_SIM_STATE_NOT_PRESENT;
 	dbus_bool_t fdn;
 	dbus_bool_t bdn;
@@ -419,10 +427,11 @@ static DBusMessage *sim_get_properties(DBusConnection *conn,
 				DBUS_TYPE_STRING,
 				(void *) &pin_name);
 
-	pin_retries = get_pin_retries(sim);
+	get_pin_retries(sim, &pin_retries_dict, &dbus_retries);
 	ofono_dbus_dict_append_dict(&dict, "Retries", DBUS_TYPE_BYTE,
-								&pin_retries);
-	g_free(pin_retries);
+							&pin_retries_dict);
+	g_free(pin_retries_dict);
+	g_free(dbus_retries);
 
 done:
 	dbus_message_iter_close_container(&iter, &dict);
@@ -437,7 +446,8 @@ static void sim_pin_retries_query_cb(const struct ofono_error *error,
 	struct ofono_sim *sim = data;
 	DBusConnection *conn = ofono_dbus_get_connection();
 	const char *path = __ofono_atom_get_path(sim->atom);
-	void **pin_retries;
+	void **pin_retries_dict;
+	unsigned char *dbus_retries;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
 		ofono_error("Querying remaining pin retries failed");
@@ -449,11 +459,12 @@ static void sim_pin_retries_query_cb(const struct ofono_error *error,
 
 	memcpy(sim->pin_retries, retries, sizeof(sim->pin_retries));
 
-	pin_retries = get_pin_retries(sim);
+	get_pin_retries(sim, &pin_retries_dict, &dbus_retries);
 	ofono_dbus_signal_dict_property_changed(conn, path,
 					OFONO_SIM_MANAGER_INTERFACE, "Retries",
-					DBUS_TYPE_BYTE,	&pin_retries);
-	g_free(pin_retries);
+					DBUS_TYPE_BYTE,	&pin_retries_dict);
+	g_free(pin_retries_dict);
+	g_free(dbus_retries);
 }
 
 static void sim_pin_retries_check(struct ofono_sim *sim)
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sim: change pin_retries array to unsigned char
  2014-12-04  9:55   ` Cedric Jehasse
@ 2014-12-04 15:00     ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2014-12-04 15:00 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

Hi Cedric,

On 12/04/2014 03:55 AM, Cedric Jehasse wrote:
> Hi Denis,
>
>> Please try the following patch (attached) and tell me if it fixes this bug
>> on your platform.
> This patch caused a segfault. Please have a look at the reworked patch
> (attached).

Yes, of course.  Thanks for cleaning up after me.  The corrected fix has 
now been pushed upstream.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-04 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-28 14:34 [PATCH] sim: change pin_retries array to unsigned char Cedric Jehasse
2014-12-03 23:38 ` Denis Kenzior
2014-12-04  9:55   ` Cedric Jehasse
2014-12-04 15:00     ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.