Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3659636pxp; Tue, 15 Mar 2022 03:45:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdkTSQ80EmWwHqkXF1qM/vFWlK+UDk7bsU6ZFcZH+1OitdtivyeMWooqD7effJTdxHLiOL X-Received: by 2002:a17:906:99c2:b0:6d7:4a6a:e35d with SMTP id s2-20020a17090699c200b006d74a6ae35dmr21791679ejn.633.1647341106565; Tue, 15 Mar 2022 03:45:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647341106; cv=none; d=google.com; s=arc-20160816; b=D43T6l/JbAAa72SKKVhz/4ERMqdRtlxFelAgoKvwzAmRp5KT+aG62sL02UHY30wz3Z y2noR6HeMwHNrfH7FS78kd80cnM+oIJSd7HkFlpVJAjLEdgOUiomZV507tFNAA/AmOe4 AanFWq6zPKyiMq98Bom4l7e8fM+XSGCrZyK4tuXPg5HKWmZiQlIz3ICtrwJuDAQczRr3 cBLx0mYMi0jdvsr6Knq+3w2+CjNBEY3LlT8Kafs8o7Dx3Q2KCCTUex9ayyDk+Aj/STqq GZcR4hzh/DSdJFMKbakXFmh2xwlLt9SK6m374Q8ziPaWLTYQWcvLGSV4kzKaydlcKP05 uSpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=qOAzIAGITBNGyHFTZ7Cmq/ShOyrjrDEaYD2HgQ928xA=; b=KWB2wG9X4wzmU6M9kq24nG2jitGMPFUJlWQUgrGVG3CwU1PvsyO7PRnPU59nKARKxZ qpq7ilCp5ZzgIR4JpR2+/2gCwvJdqRBYfbExDLDETVA2Webs08gn/J5HhRQ3rcCfvrlS 8kbJMu+qkEP9nnGLYz6C+nb7msP4iDKJP3RnmsWk5ynFtl+PWMPnVj2B6XpfxkHFca1h jOHM6ZA6Wm+p9oskUZNc8lb6KUciezIb2zYqJ55wEqC66ErR9KQIC6lYvIQavVNcXciu t46Np8mo2/X0LNB1WC+CXZqnxD3gDbdilUlAzemVRgLZozQ8ekyGYoKvgzeJ+ywoENu5 oKYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DLYCCBHw; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w17-20020a17090633d100b006dbb84c3034si5252262eja.375.2022.03.15.03.44.21; Tue, 15 Mar 2022 03:45:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DLYCCBHw; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244579AbiCNVv3 (ORCPT + 99 others); Mon, 14 Mar 2022 17:51:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236193AbiCNVv2 (ORCPT ); Mon, 14 Mar 2022 17:51:28 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58030344CE for ; Mon, 14 Mar 2022 14:50:18 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id s42so16352340pfg.0 for ; Mon, 14 Mar 2022 14:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=qOAzIAGITBNGyHFTZ7Cmq/ShOyrjrDEaYD2HgQ928xA=; b=DLYCCBHwiNA5sjj3uvWwFKxvEiTB0jetmihNzm67O409zkWwRO48S4VDNj183TGhBz HMCnDIGgruSeuktVZg7obi6p4q+veP7iHNkLshZijvIrZcnbOaBr0ILMmRtDh0TCJ5Ip qhnwNgEExppuPFN/fZU4qL07RoCAByPUoDCDMnXvvJz8Yc2kxniFSRWvnzaw0AxGpbpX Lzsxx2umpULGzoQkYQ8WE4bC6fxFQXHPNJjmu2kOCAPdMy+xMqRpzW5xxDrb0cmxSdyN D6bEZKISbhZMoislZ0Aook0cQ1/u7sHI+wBqOC16t2jh/RZ/fC41Ei7l9hgJcvgKi/eY v/DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=qOAzIAGITBNGyHFTZ7Cmq/ShOyrjrDEaYD2HgQ928xA=; b=VB8EIOYcQj2ycwR6289fnGNdQbbEhUlmBvswbt1Hc4v8447baaUI41CrDp5udJVTWI kXTEB85Ej/fqmWGQpVmn980+mH/PJuy2vuG/Kv2VQ2oO78UDNoTxs9g/Qax6FDY+7QJ7 0uQnv7uxUzp806qMH+ZxjOBJb9cVDQ4FLmVtghNkBLoz6gUyDZUZragTjT2U9UIF2Mcy yNXuQk+OkePYhHEAvEn8WiM9RpN9JGoFjJOjGazhsR3h18Es3w7KaUZNkNSKoF3M1Zhl Y5PWud8MjuF5bPhcdLYMLXeLkb4v+NRsRgO1X9Fjo83mpUSIopuP4ZgVwVj9D68knohM c/GQ== X-Gm-Message-State: AOAM532NtSLdRF3zRy2nA1ly7cTBL+nukdeWiYYrWQ6Ji31ylMzbfhNr 0d5yMSn45GdWlhdaMv0lk2AmZdlAS4M= X-Received: by 2002:a63:9c4:0:b0:380:f8fd:561d with SMTP id 187-20020a6309c4000000b00380f8fd561dmr18248153pgj.60.1647294617305; Mon, 14 Mar 2022 14:50:17 -0700 (PDT) Received: from lvondent-mobl4.intel.com (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id s15-20020a63af4f000000b0037c8875108dsm18029032pgo.45.2022.03.14.14.50.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 14:50:17 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 1/2] gatt: Print error if gatt_db_attribut_notify fails Date: Mon, 14 Mar 2022 14:50:09 -0700 Message-Id: <20220314215010.23822-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This prints an error if gatt_db_attribut_notify fails. --- src/gatt-database.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gatt-database.c b/src/gatt-database.c index 485af04ea..d6c94058c 100644 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -1523,8 +1523,9 @@ static void send_service_changed(struct btd_gatt_database *database, put_le16(start, value); put_le16(end, value + 2); - gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value), - NULL); + if (!gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value), + NULL)) + error("Failed to notify Service Changed"); } static void gatt_db_service_added(struct gatt_db_attribute *attrib, @@ -3967,6 +3968,7 @@ void btd_gatt_database_restore_svc_chng_ccc(struct btd_gatt_database *database) put_le16(0x0001, value); put_le16(0xffff, value + 2); - gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value), - NULL); + if (!gatt_db_attribute_notify(database->svc_chngd, value, sizeof(value), + NULL)) + error("Failed to notify Service Changed"); } -- 2.35.1