All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] android/gatt: Fix wrong check
@ 2014-06-12 10:40 Andrei Emeltchenko
  2014-06-13 14:44 ` Szymon Janc
  0 siblings, 1 reply; 5+ messages in thread
From: Andrei Emeltchenko @ 2014-06-12 10:40 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

---
 android/gatt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/gatt.c b/android/gatt.c
index cc3746c..8da77d0 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -4133,8 +4133,8 @@ static void fill_gatt_response_by_handle(uint16_t handle, uint16_t offset,
 
 	entry = queue_find(dev->pending_requests, match_dev_request_by_handle,
 							UINT_TO_PTR(handle));
-	if (entry) {
-		DBG("No pending response found! Bogus android response?");
+	if (!entry) {
+		error("No pending response found! Bogus android response?");
 		return;
 	}
 
-- 
1.8.3.2


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

* Re: [PATCH] android/gatt: Fix wrong check
  2014-06-12 10:40 [PATCH] android/gatt: Fix wrong check Andrei Emeltchenko
@ 2014-06-13 14:44 ` Szymon Janc
  0 siblings, 0 replies; 5+ messages in thread
From: Szymon Janc @ 2014-06-13 14:44 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

On Thursday 12 of June 2014 13:40:54 Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> ---
>  android/gatt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index cc3746c..8da77d0 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -4133,8 +4133,8 @@ static void fill_gatt_response_by_handle(uint16_t handle, uint16_t offset,
>  
>  	entry = queue_find(dev->pending_requests, match_dev_request_by_handle,
>  							UINT_TO_PTR(handle));
> -	if (entry) {
> -		DBG("No pending response found! Bogus android response?");
> +	if (!entry) {
> +		error("No pending response found! Bogus android response?");
>  		return;
>  	}

I've already pushed similar fix from Marcin. But please rebase and send
DBG to error change.

-- 
Best regards, 
Szymon Janc

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

* Re: [PATCH] android/gatt: Fix wrong check
  2014-06-12 10:08 ` Marcel Holtmann
@ 2014-06-12 10:40   ` Andrei Emeltchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andrei Emeltchenko @ 2014-06-12 10:40 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

On Thu, Jun 12, 2014 at 12:08:29PM +0200, Marcel Holtmann wrote:
> Hi Andrei,
> 
> > android/gatt.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/android/gatt.c b/android/gatt.c
> > index cc3746c..08da856 100644
> > --- a/android/gatt.c
> > +++ b/android/gatt.c
> > @@ -4133,7 +4133,7 @@ static void fill_gatt_response_by_handle(uint16_t handle, uint16_t offset,
> > 
> > 	entry = queue_find(dev->pending_requests, match_dev_request_by_handle,
> > 							UINT_TO_PTR(handle));
> > -	if (entry) {
> > +	if (!entry) {
> > 		DBG("No pending response found! Bogus android response?");
> > 		return;
> 
> on a different note, if this is a case that is not suppose to happen and indicates a bug in Android Bluetooth service, we should at minimum print a warning here and not debug. Maybe even just print an error.
> 

so change DGB() to error() ?

Best regards 
Andrei Emeltchenko 

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

* Re: [PATCH] android/gatt: Fix wrong check
  2014-06-12  9:58 Andrei Emeltchenko
@ 2014-06-12 10:08 ` Marcel Holtmann
  2014-06-12 10:40   ` Andrei Emeltchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2014-06-12 10:08 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

> android/gatt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/android/gatt.c b/android/gatt.c
> index cc3746c..08da856 100644
> --- a/android/gatt.c
> +++ b/android/gatt.c
> @@ -4133,7 +4133,7 @@ static void fill_gatt_response_by_handle(uint16_t handle, uint16_t offset,
> 
> 	entry = queue_find(dev->pending_requests, match_dev_request_by_handle,
> 							UINT_TO_PTR(handle));
> -	if (entry) {
> +	if (!entry) {
> 		DBG("No pending response found! Bogus android response?");
> 		return;

on a different note, if this is a case that is not suppose to happen and indicates a bug in Android Bluetooth service, we should at minimum print a warning here and not debug. Maybe even just print an error.

Regards

Marcel


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

* [PATCH] android/gatt: Fix wrong check
@ 2014-06-12  9:58 Andrei Emeltchenko
  2014-06-12 10:08 ` Marcel Holtmann
  0 siblings, 1 reply; 5+ messages in thread
From: Andrei Emeltchenko @ 2014-06-12  9:58 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

---
 android/gatt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/gatt.c b/android/gatt.c
index cc3746c..08da856 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -4133,7 +4133,7 @@ static void fill_gatt_response_by_handle(uint16_t handle, uint16_t offset,
 
 	entry = queue_find(dev->pending_requests, match_dev_request_by_handle,
 							UINT_TO_PTR(handle));
-	if (entry) {
+	if (!entry) {
 		DBG("No pending response found! Bogus android response?");
 		return;
 	}
-- 
1.8.3.2


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

end of thread, other threads:[~2014-06-13 14:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-12 10:40 [PATCH] android/gatt: Fix wrong check Andrei Emeltchenko
2014-06-13 14:44 ` Szymon Janc
  -- strict thread matches above, loose matches on Subject: below --
2014-06-12  9:58 Andrei Emeltchenko
2014-06-12 10:08 ` Marcel Holtmann
2014-06-12 10:40   ` Andrei Emeltchenko

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.