linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] service: Remove extra memory copying from cancel_authorization
@ 2012-10-02  9:33 Szymon Janc
  2012-10-02  9:33 ` [PATCH 2/2] agent: Remote not used variables from pincode_reply Szymon Janc
  2012-10-02  9:50 ` [PATCH 1/2] service: Remove extra memory copying from cancel_authorization Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Szymon Janc @ 2012-10-02  9:33 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

src is never read before being overwritten few lines below.

---
 plugins/service.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/plugins/service.c b/plugins/service.c
index 45886ac..d586d79 100644
--- a/plugins/service.c
+++ b/plugins/service.c
@@ -662,11 +662,6 @@ static DBusMessage *cancel_authorization(DBusConnection *conn,
 	if (auth == NULL)
 		return btd_error_does_not_exist(msg);
 
-	if (serv_adapter->adapter)
-		adapter_get_address(serv_adapter->adapter, &src);
-	else
-		bacpy(&src, BDADDR_ANY);
-
 	btd_cancel_authorization(auth->id);
 
 	reply = btd_error_not_authorized(auth->msg);
-- 
1.7.9.5


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

* [PATCH 2/2] agent: Remote not used variables from pincode_reply
  2012-10-02  9:33 [PATCH 1/2] service: Remove extra memory copying from cancel_authorization Szymon Janc
@ 2012-10-02  9:33 ` Szymon Janc
  2012-10-02  9:50 ` [PATCH 1/2] service: Remove extra memory copying from cancel_authorization Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Szymon Janc @ 2012-10-02  9:33 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

adapter and sba are not used later in function code.

---
 src/agent.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/agent.c b/src/agent.c
index 8cf37b1..e206c56 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -355,16 +355,12 @@ static void pincode_reply(DBusPendingCall *call, void *user_data)
 {
 	struct agent_request *req = user_data;
 	struct agent *agent = req->agent;
-	struct btd_adapter *adapter = agent->adapter;
 	agent_pincode_cb cb = req->cb;
 	DBusMessage *message;
 	DBusError err;
-	bdaddr_t sba;
 	size_t len;
 	char *pin;
 
-	adapter_get_address(adapter, &sba);
-
 	/* steal_reply will always return non-NULL since the callback
 	 * is only called after a reply has been received */
 	message = dbus_pending_call_steal_reply(call);
-- 
1.7.9.5


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

* Re: [PATCH 1/2] service: Remove extra memory copying from cancel_authorization
  2012-10-02  9:33 [PATCH 1/2] service: Remove extra memory copying from cancel_authorization Szymon Janc
  2012-10-02  9:33 ` [PATCH 2/2] agent: Remote not used variables from pincode_reply Szymon Janc
@ 2012-10-02  9:50 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2012-10-02  9:50 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On Tue, Oct 02, 2012, Szymon Janc wrote:
> src is never read before being overwritten few lines below.
> 
> ---
>  plugins/service.c |    5 -----
>  1 file changed, 5 deletions(-)

Both patches have been applied. Thanks.

Johan

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

end of thread, other threads:[~2012-10-02  9:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-02  9:33 [PATCH 1/2] service: Remove extra memory copying from cancel_authorization Szymon Janc
2012-10-02  9:33 ` [PATCH 2/2] agent: Remote not used variables from pincode_reply Szymon Janc
2012-10-02  9:50 ` [PATCH 1/2] service: Remove extra memory copying from cancel_authorization Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).