All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sim: Check SIM pin status after changing pin.
@ 2010-11-02 15:08 Marit Henriksen
  2010-11-02 15:22 ` Denis Kenzior
  0 siblings, 1 reply; 5+ messages in thread
From: Marit Henriksen @ 2010-11-02 15:08 UTC (permalink / raw)
  To: ofono

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

From: Marit Henriksen <marit.henriksen@stericsson.com>

When changing pin, it is possible to get in a state where the modem requests puk 
(if incorrect pin is entered too many times). Need to check the SIM pin status 
to discover this.
---
 src/sim.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/sim.c b/src/sim.c
index 699ebe9..b2277c5 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -628,15 +628,16 @@ static DBusMessage *sim_unlock_pin(DBusConnection *conn, DBusMessage *msg,
 static void sim_change_pin_cb(const struct ofono_error *error, void *data)
 {
 	struct ofono_sim *sim = data;
+	DBusMessage *reply;
 
-	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		__ofono_dbus_pending_reply(&sim->pending,
-				__ofono_error_failed(sim->pending));
-		return;
-	}
+	if (error->type != OFONO_ERROR_TYPE_NO_ERROR)
+		reply = __ofono_error_failed(sim->pending);
+	else
+		reply = dbus_message_new_method_return(sim->pending);
 
-	__ofono_dbus_pending_reply(&sim->pending,
-				dbus_message_new_method_return(sim->pending));
+	__ofono_dbus_pending_reply(&sim->pending, reply);
+
+	sim_pin_check(sim);
 }
 
 static DBusMessage *sim_change_pin(DBusConnection *conn, DBusMessage *msg,
-- 
1.7.0.4


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

end of thread, other threads:[~2010-11-05 20:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-02 15:08 [PATCH] sim: Check SIM pin status after changing pin Marit Henriksen
2010-11-02 15:22 ` Denis Kenzior
2010-11-05 14:25   ` Marit Sofie Henriksen
2010-11-05 20:12     ` Denis Kenzior
2010-11-05 20:19     ` Marcel Holtmann

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.