2017-07-06 15:06:36

by Syam Sidhardhan

[permalink] [raw]
Subject: [PATCH 1/1] shared/gatt-server: Remove unwanted pointer validation

Here the memory address pointed by the variable op is always valid.
---
src/shared/gatt-server.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/shared/gatt-server.c b/src/shared/gatt-server.c
index 79e01c8..dc3bb8e 100644
--- a/src/shared/gatt-server.c
+++ b/src/shared/gatt-server.c
@@ -803,8 +803,7 @@ static void write_cb(uint8_t opcode, const void *pdu,
write_complete_cb, op))
return;

- if (op)
- async_write_op_destroy(op);
+ async_write_op_destroy(op);

ecode = BT_ATT_ERROR_UNLIKELY;

--
1.7.9.5



2017-07-07 08:11:34

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH 1/1] shared/gatt-server: Remove unwanted pointer validation

Hi Syam,

On Thu, Jul 6, 2017 at 6:06 PM, Syam Sidhardhan <[email protected]> wrote:
> Here the memory address pointed by the variable op is always valid.
> ---
> src/shared/gatt-server.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/shared/gatt-server.c b/src/shared/gatt-server.c
> index 79e01c8..dc3bb8e 100644
> --- a/src/shared/gatt-server.c
> +++ b/src/shared/gatt-server.c
> @@ -803,8 +803,7 @@ static void write_cb(uint8_t opcode, const void *pdu,
> write_complete_cb, op))
> return;
>
> - if (op)
> - async_write_op_destroy(op);
> + async_write_op_destroy(op);
>
> ecode = BT_ATT_ERROR_UNLIKELY;
>
> --
> 1.7.9.5

Applied, thanks.

--
Luiz Augusto von Dentz