All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] sim: fix segfault in sim atom
@ 2019-03-07  5:23 Anirudh Gargi
  2019-03-07 16:25 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Anirudh Gargi @ 2019-03-07  5:23 UTC (permalink / raw)
  To: ofono

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

While adding the sim pin cache feature, pin_name could cause issue in
cases when sim pin is not there.

log:
ofonod[27810]: drivers/atmodem/sim.c:at_cpin_cb() crsm_pin_cb: READY
ofonod[27810]: src/sim.c:sim_pin_query_cb() sim->pin_type: 0, pin_type: 0
ofonod[27810]: Aborting (signal 11) [./src/ofonod]
ofonod[27810]: ++++++++ backtrace ++++++++
ofonod[27810]: #0  0x7fb7a7586cb0 in /lib/x86_64-linux-gnu/libc.so.6
ofonod[27810]: #1  0x7fb7a7693cd8 in /lib/x86_64-linux-gnu/libc.so.6
ofonod[27810]: #2  0x4d899b in sim_pin_query_cb() at src/sim.c:3174
ofonod[27810]: #3  0x4649e7 in at_cpin_cb() at drivers/atmodem/sim.c:1304
ofonod[27810]: #4  0x4a5d70 in at_chat_finish_command() at gatchat/gatchat.c:462
---
 src/sim.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/sim.c b/src/sim.c
index 104ddd1..c6ea4b0 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -3127,7 +3127,7 @@ static void sim_pin_query_cb(const struct ofono_error *error,
 	DBusConnection *conn = ofono_dbus_get_connection();
 	const char *path = __ofono_atom_get_path(sim->atom);
 	struct cached_pin *cpins = pin_cache_lookup(sim->iccid);
-	const char *pin_name;
+	const char *pin_name = sim_passwd_name(pin_type);
 	char **locked_pins;
 	gboolean lock_changed;
 
@@ -3140,7 +3140,6 @@ static void sim_pin_query_cb(const struct ofono_error *error,
 
 	if (sim->pin_type != pin_type) {
 		sim->pin_type = pin_type;
-		pin_name = sim_passwd_name(pin_type);
 
 		if (pin_type != OFONO_SIM_PASSWORD_NONE &&
 				password_is_pin(pin_type) == FALSE)
-- 
2.7.4


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

* Re: [PATCH 1/1] sim: fix segfault in sim atom
  2019-03-07  5:23 [PATCH 1/1] sim: fix segfault in sim atom Anirudh Gargi
@ 2019-03-07 16:25 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2019-03-07 16:25 UTC (permalink / raw)
  To: ofono

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

Hi Anirudh,

On 03/06/2019 11:23 PM, Anirudh Gargi wrote:
> While adding the sim pin cache feature, pin_name could cause issue in
> cases when sim pin is not there.
> 
> log:
> ofonod[27810]: drivers/atmodem/sim.c:at_cpin_cb() crsm_pin_cb: READY
> ofonod[27810]: src/sim.c:sim_pin_query_cb() sim->pin_type: 0, pin_type: 0
> ofonod[27810]: Aborting (signal 11) [./src/ofonod]
> ofonod[27810]: ++++++++ backtrace ++++++++
> ofonod[27810]: #0  0x7fb7a7586cb0 in /lib/x86_64-linux-gnu/libc.so.6
> ofonod[27810]: #1  0x7fb7a7693cd8 in /lib/x86_64-linux-gnu/libc.so.6
> ofonod[27810]: #2  0x4d899b in sim_pin_query_cb() at src/sim.c:3174
> ofonod[27810]: #3  0x4649e7 in at_cpin_cb() at drivers/atmodem/sim.c:1304
> ofonod[27810]: #4  0x4a5d70 in at_chat_finish_command() at gatchat/gatchat.c:462
> ---
>   src/sim.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 

Applied, thanks.

Regards,
-Denis


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

end of thread, other threads:[~2019-03-07 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07  5:23 [PATCH 1/1] sim: fix segfault in sim atom Anirudh Gargi
2019-03-07 16:25 ` 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.