From db5d83d6f3b897066a818f45c57cc3120e7f4e96 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 20 Dec 2012 11:01:30 +0200 Subject: [PATCH] core: Fix display_pincode_cb behavior The data pointer should be the authentication request and not the device. Also, the pincode_cb function already checks for auth->agent == NULL and will also do the agent_unref call if necessary. --- src/device.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/device.c b/src/device.c index c5222ee89..3cfb816e3 100644 --- a/src/device.c +++ b/src/device.c @@ -3740,17 +3740,10 @@ static void display_pincode_cb(struct agent *agent, DBusError *err, void *data) struct authentication_req *auth = data; struct btd_device *device = auth->device; - /* No need to reply anything if the authentication already failed */ - if (auth->agent == NULL) - return; - - pincode_cb(agent, err, auth->pincode, device); + pincode_cb(agent, err, auth->pincode, auth); g_free(device->authr->pincode); device->authr->pincode = NULL; - - agent_unref(device->authr->agent); - device->authr->agent = NULL; } static struct authentication_req *new_auth(struct btd_device *device, -- 2.47.3