Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp409940lqp; Wed, 12 Jun 2024 05:37:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlYjY8AXT/DQac87IoE7vHst6nVwuHtL58hN8BVlHJDm8v22SxIhBo642YaVW+SPKDtQNXUGaU81RMsdU5dpG1/CD1KWDym/s53F9aIA== X-Google-Smtp-Source: AGHT+IEtj+LrPPfD7dv9G/6XzojVBCFRy4nLABkgHHGNp0JAPnrNPE2EycdGXYPZ4zO9JrZNH9Gr X-Received: by 2002:a05:6214:451b:b0:6b0:4b83:1f55 with SMTP id 6a1803df08f44-6b1a7bd2099mr17561556d6.56.1718195865850; Wed, 12 Jun 2024 05:37:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718195865; cv=pass; d=google.com; s=arc-20160816; b=BHIpLfhHBOMYPsr/yjAsaXXxvpCtd52mEkUCKvEWRFyFn8bjFgSW7h4tCL7I42nJ9F Qq8ijCwMFdGiRm4WQKM4FbU7ECNAHsyuinnzYkCe4sC82EueJRU8p5zMHPUVFJhqWqjv mAyxU7KSZwIpG+AK2aZIXG7LEdTOK7FbAUf3N+io/mS9Ksmqs5QpxuDaKn+r6E33qmbZ cPYi9WCpveqBel24X/MFf04uQBX2/chTQt8Ktk/8Qwe3nVHQMC8bqlZv6k+NownasKcx Ec3+ima98sIwaM42WVUB+3z12LZly4mOwZ5+j/NXcZQ8JwevD3BkPbHPl4Tj7sQbrYu+ gP5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=p96uUxQOoHzqFpi1OyHubdPKWLJfefsiFVXI61S3V4g=; fh=4DKPLiPDlS+DYY/B2n/08KwGDjw/+CX2QWz/R1uHgOU=; b=uuyrs0fOxNkHl53hYCLM7YD0wrWHul8J4s0PbBVGQRBs092jB4jZmyPTPzOh87Yrio YdbdbOK5d9Y134n4TYinUavN3HmQBiMMOhBGiG+ICUx9y+ITSpM7sQlwRnWtiee6zkNM kBrwnWvZKZppQTSIFFNqpak5uPh5djV0Y2OkjQye3dnSTvf+M/azNbZteXN0C4Xim0R3 /uXTM+KMU3NuDdiySoZDmsUoGfi+x8p+oQRxbm+XM6M6qL1w+xfefaOTjsXKirwRbWOw kmsEP7/OoHGqd+i9SHkz9JhyFKke3jfCGO1QtXQGKqXPUlnbFyObqWzwEh4ab0MFbalS eYNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cU3BPSE+; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-bluetooth+bounces-5280-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5280-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-4405a523d75si98526401cf.378.2024.06.12.05.37.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 05:37:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-5280-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cU3BPSE+; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-bluetooth+bounces-5280-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5280-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8F2ED1C21849 for ; Wed, 12 Jun 2024 12:37:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63CC4170835; Wed, 12 Jun 2024 12:37:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cU3BPSE+" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10B98171E7D for ; Wed, 12 Jun 2024 12:37:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718195842; cv=none; b=a2+A/JbRP9y2HhOAPLy+hmvo9J8Xplb7+M+eFzlXgfaZuhLYa6UuWRClJ21zI/IWBhDaA8l4asI5EUrcy2CNBD488dFhwFIkh8cNk4MnA5Q3ShJQskl4WUSO/9PKWcc9ixeSx+DyG6lomlDVLVH83HalIxVI5kTkFrPvgWEh2/I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718195842; c=relaxed/simple; bh=q9Hi4EAC7u/D8TWFxDRTyUT9vdV7F9/lgJX0aCN1TAk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=eQ+lHaiv/rzxymZzWCBpqdphMn5psc1vhkbxP/YT8xbA9fy7iqvjOpSMhd0AUs/CHXL1l/CvdaOcAaEWa2VQQhklAPgTldMROi74lerkje0TlHqLS/GlLpVF185wFHM29pODKyqSCgFPAvjjh7Cha94dQoh5N5+xW/DTf6v6sto= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=cU3BPSE+; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-52bc335e49aso2930192e87.3 for ; Wed, 12 Jun 2024 05:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718195839; x=1718800639; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=p96uUxQOoHzqFpi1OyHubdPKWLJfefsiFVXI61S3V4g=; b=cU3BPSE+y4Uq1G6gwLaQocOFtc2EjhIQN8kFIJPJet9r5ZGGdRLvFjBpzCrKLsT/qr X4jtjVEh9twY/QiTl2Otnk9tWgspdWf+ECQtrD5Edb9j8l26fe0nZSJyc12/iDU+LH4k hrAxkk6NgdWmJ2ORWkw3czlpUmYfp1XGu3zpOFk+CfYmdEwml4EJ+0tGMAZggKxG/K4p FpYtdSro1gg16Q1mzyY2XT4e9qASCAimmFod+5d1KEbvU/8a7iAqAkAkaM7IoI0XWXvQ 7COM/ymG0pBKp1LmlInPwwvjg0LyRCJF/8F0EzeRoZ2jJ156E0XlL76V8nhsT9nVDZYM 0xNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718195839; x=1718800639; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=p96uUxQOoHzqFpi1OyHubdPKWLJfefsiFVXI61S3V4g=; b=fwBP31OQmQmgOs6Gmc+MJBTxT0TFgg2zQ65quveOiUnaX0MlqKtmomghDzUor/Or4J pS0fJhQ4GD9eox5lnNc576q5KIBuTedb7R78FnFu0KJ7N0/Fr57Sbbck6qUJoa3ZKFqW /7R1xI9wuhgByiT8L/723zdgx3klTX6tZ2cxLj4zghoyXispFVWwD8POdu3CbYxFUF8a h7TJyW7GfhxrRT0v1FeJ8+O17oFDq+TdeYRYvCu7IyD3Ke5D5aNqAKJTy4NujuMnB8sE wFEKbId8PRnv7bMFL5LKZn2I0TlJ7O+1UEipAQu/4LJ7oMvNc3XGEv4xnm5z9GpNYKi1 t4Zg== X-Gm-Message-State: AOJu0YwpS0eYFTkxgzdN6pEDHvgfhAH2TocnPC4K6YvlJsjOfwkkfNAD L6RYKhELsxnSsnP8bP+apNZOhOHX1te+WabDVqXuNs6fuOk18qf8uDxStEs/SrBellohn/fFVgr D X-Received: by 2002:a05:6512:3989:b0:52c:9d38:9df1 with SMTP id 2adb3069b0e04-52c9d389e68mr1313197e87.10.1718195839005; Wed, 12 Jun 2024 05:37:19 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f24ebfbbbsm8080432f8f.61.2024.06.12.05.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 05:37:18 -0700 (PDT) Date: Wed, 12 Jun 2024 15:37:14 +0300 From: Dan Carpenter To: Iulia Tanasescu Cc: linux-bluetooth@vger.kernel.org Subject: [bug report] Bluetooth: ISO: Use defer setup to separate PA sync and BIG sync Message-ID: <1fe76229-9b40-400d-9d63-03a025603bdf@moroto.mountain> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello Iulia Tanasescu, Commit fbdc4bc47268 ("Bluetooth: ISO: Use defer setup to separate PA sync and BIG sync") from Aug 17, 2023 (linux-next), leads to the following Smatch static checker warning: net/bluetooth/iso.c:1364 iso_sock_recvmsg() error: we previously assumed 'pi->conn->hcon' could be null (see line 1359) net/bluetooth/iso.c 1347 static int iso_sock_recvmsg(struct socket *sock, struct msghdr *msg, 1348 size_t len, int flags) 1349 { 1350 struct sock *sk = sock->sk; 1351 struct iso_pinfo *pi = iso_pi(sk); 1352 1353 BT_DBG("sk %p", sk); 1354 1355 if (test_and_clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) { 1356 lock_sock(sk); 1357 switch (sk->sk_state) { 1358 case BT_CONNECT2: 1359 if (pi->conn->hcon && ^^^^^^^^^^^^^^ If ->hcon is NULL 1360 test_bit(HCI_CONN_PA_SYNC, &pi->conn->hcon->flags)) { 1361 iso_conn_big_sync(sk); 1362 sk->sk_state = BT_LISTEN; 1363 } else { --> 1364 iso_conn_defer_accept(pi->conn->hcon); ^^^^^^^^^^^^^^ then we're toast 1365 sk->sk_state = BT_CONFIG; 1366 } 1367 release_sock(sk); 1368 return 0; 1369 case BT_CONNECTED: 1370 if (test_bit(BT_SK_PA_SYNC, &iso_pi(sk)->flags)) { regards, dan carpenter