From 6c8eebe0468ad4f5980e51cb23e5e8e48f83133d Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 19 Aug 2019 12:24:04 +0300 Subject: [PATCH] Bluetooth: GATT: Fix dereference after NULL check This fixes the coverity problem which which in fact is a non-issue as the code would assert before reaching that line which makes the NULL pointer check useless so this removes it. Fixes #18431 Signed-off-by: Luiz Augusto von Dentz --- tests/bluetooth/gatt/src/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/bluetooth/gatt/src/main.c b/tests/bluetooth/gatt/src/main.c index 6686a0a4ccb..98def6f8a3c 100644 --- a/tests/bluetooth/gatt/src/main.c +++ b/tests/bluetooth/gatt/src/main.c @@ -234,10 +234,8 @@ void test_gatt_read(void) &test_chrc_uuid.uuid, NULL, 0, find_attr, &attr); zassert_not_null(attr, "Attribute don't match"); - if (attr) { - zassert_equal(attr->uuid, &test_chrc_uuid.uuid, + zassert_equal(attr->uuid, &test_chrc_uuid.uuid, "Attribute UUID don't match"); - } ret = attr->read(NULL, attr, (void *)buf, sizeof(buf), 0); zassert_equal(ret, strlen(test_value),