Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1628256rdb; Mon, 2 Oct 2023 16:13:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlSXLaaZ6PlraszyVXPXe+VXAoLkW5RpLYDcK1hWpkY9aS1TpEgS1e9Oqnxb5CLgS7m+Wh X-Received: by 2002:a17:902:e850:b0:1c3:19d6:3559 with SMTP id t16-20020a170902e85000b001c319d63559mr1670513plg.1.1696288405115; Mon, 02 Oct 2023 16:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696288405; cv=none; d=google.com; s=arc-20160816; b=LP5us5fBAhFmfyPNdH8Kjd+HXTbwT834eooC+B37Ewlz3aSSHVWoAt9HZioA7Gdbl4 5Oa1q3wsiTjb5ZBKYLe3aOhp94g4G+8AVYs+fiIs1fLEXtu2ghApIuWmDBhz59ai+KNY pd6sMj3zBV2u0jA/5h/0WR5PE2Uux318vteb0h6trohA6sqgjPrDbcxrjP+RhDzcxBYI IIULY/N4ri26iXkFEUQZUX5EUvkpRkKTi6rb/ZAQlYrild4cLtYhjyo6xLO1AmlXTmcV e+W3IlDp9an6B52ZtePMmh/If0iCRI2PUAyA3C9CJAY7mMAk7fisnpkDuLgqnhgCBtHc f3/A== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=kXfx1LMcF2ZoyM6EdfEh52gSmxJjZ/+b1hClxDBVCaM=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=wMqsSCIb1NvvLDsanRTYH2+bpOkvEoTNkaUodvw5sKeB/E6LZdcWWI8ibd4Us2XN/A qbg/CEvP33O8lz4zo6VXFDNrZuYNYm+wiTWsQrC2+sYfYLnNLaZrk332DI4GsGDhrvFY iW9ZBso039nt1bFwmSEUZRTkbYjhgKc4qbIE0eQOc6xGOlO1QU+H7lJNFGrbxoTfbGsp zrixrYWt4+Rgq9e/iSXLhRiHaWpqV333aj+UUfDhbC8nAj/p+TaUiNs6ttsACp+nPc51 f31gsHnFHUKXcWthuxAbi9TVFmNO2lAhGevbtvLiGPibK/yI9y940yUnXgsSJ/Mt36gz ERlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QhYiUB+x; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u13-20020a17090341cd00b001c725e4ae5csi15378113ple.589.2023.10.02.16.13.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 16:13:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QhYiUB+x; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D7961802A37A; Mon, 2 Oct 2023 16:13:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237209AbjJBXNV (ORCPT + 99 others); Mon, 2 Oct 2023 19:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237155AbjJBXNU (ORCPT ); Mon, 2 Oct 2023 19:13:20 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B646AC for ; Mon, 2 Oct 2023 16:13:18 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1c5db4925f9so1955415ad.1 for ; Mon, 02 Oct 2023 16:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696288397; x=1696893197; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=kXfx1LMcF2ZoyM6EdfEh52gSmxJjZ/+b1hClxDBVCaM=; b=QhYiUB+xyQ0Szk6Aw0mnaf10msNzj2RMNGNmEtNi4bWBTRiVlr9bG9/nZd50mjclx8 B1QH3IGSCKXlL9xtPVA8n8RCw8j6NfjT6P5xzgpxt8VqwPniFZLFCFPyLN7Q/DbDH9Ie yGQN5H6Jrh/vSjS6frRHEax9YYeGpf2sFkCPH3eFDYdvi7ChXmdCOntSwtfB1Z7iv4Wp 6gA/T+b0yy03NrX/KO6amo+b/ZiVPMIitpaRzH3xbiDnlIKvf4CMyRUPhMUop4gva5PL yddcQdnTnffCa3arJZOuTsxw8QUdaw2UbhNqvmAHk/K0IdgvyJMA+M1L6j3uxndfZfy+ gwmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696288397; x=1696893197; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kXfx1LMcF2ZoyM6EdfEh52gSmxJjZ/+b1hClxDBVCaM=; b=Lkbw/nBcLvvPhwGZG6lOnALWZ2MgIuSSf8Aob6ewJxt0qCLzwCtVQHbiogqcFOAJ0I VSrVWTXrOSyXksHKI0TMorNBpaw5kKBAnDY4dkvJ/7uF4wwCl4ilKSmHHYCRUYdpqmWr FjZljMzo52aHJ7oNHq0dvgzAG4nqXvZSfMUoD8TeyRw1zwpDoMb2dT+xQpH1vGiOlQRd sy0hmWInB8N+1skNST9wkxQgkEj4etquQ9oEbsxwsHf/u9j8JLEL4BdFOhwsYyc31DPB 270b0jM9m5xEXzmNZUmEP8Ss0v+DrbU4mxrmatMevzgPwdXbhzjtcEWPxSPIEQDrD5f8 XZiA== X-Gm-Message-State: AOJu0Yzrly9RUm45ohv7Qh97FoAwCQBnYsBC/8vuRfCtdQUHIFFJpPRo /qs4qjxL+ri9BtgfzJgsRuI4Md1di4N43b+J X-Received: by 2002:a17:903:18e:b0:1c6:de7:add9 with SMTP id z14-20020a170903018e00b001c60de7add9mr1424616plg.19.1696288396642; Mon, 02 Oct 2023 16:13:16 -0700 (PDT) Received: from lvondent-mobl4.. (c-98-232-221-87.hsd1.or.comcast.net. [98.232.221.87]) by smtp.gmail.com with ESMTPSA id l11-20020a170902d34b00b001c75627545csm5181817plk.135.2023.10.02.16.13.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 16:13:15 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 3/6] shared/csip: Fix not always reading SIRK value Date: Mon, 2 Oct 2023 16:13:07 -0700 Message-ID: <20231002231311.3104749-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231002231311.3104749-1-luiz.dentz@gmail.com> References: <20231002231311.3104749-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 02 Oct 2023 16:13:21 -0700 (PDT) From: Luiz Augusto von Dentz This makes sure the SIRK value is always read otherwise its value can be outdated or not even read if the connection was interrupted before read procedure was completed. --- src/shared/csip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/csip.c b/src/shared/csip.c index eb80bbc3b26c..85de63ea626b 100644 --- a/src/shared/csip.c +++ b/src/shared/csip.c @@ -597,7 +597,7 @@ static void foreach_csis_char(struct gatt_db_attribute *attr, void *user_data) DBG(csip, "SIRK found: handle 0x%04x", value_handle); csis = csip_get_csis(csip); - if (!csis || csis->sirk) + if (!csis) return; csis->sirk = attr; -- 2.41.0