Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp250072rdd; Tue, 9 Jan 2024 03:04:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGz2L753GNspDyHh/w0gPOxziWla6t7s55PTlYTIEIAuhHZXKSna+kEyjjMCvFA0zjLNEo2 X-Received: by 2002:a05:6214:411c:b0:67a:b6e7:2a0 with SMTP id kc28-20020a056214411c00b0067ab6e702a0mr6272855qvb.47.1704798248947; Tue, 09 Jan 2024 03:04:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704798248; cv=none; d=google.com; s=arc-20160816; b=lIwG4CI6CcyNJAOHrrmsFyfZqGNT267xGKNBhg7w4PwtGBISlwmO9wDr7TU3dXvG60 ZJmI5WSVScnRxTRpKYkNIMEb8/TQY5R6kXB5qaWjBk/SJRRyXaiyj+T1uMLNnk3zMvyc fqlChv4UVub18AkpQzH4D7XWn3cXcUyIvhlK9OtjpLUcSKVtaCpSrPA2rUdsvr2ee/2j TUc0IbY4uplNrxQFEudG0sN544TAPctmOE0Senhgi/7zSfpqI8BGMgGaB/GUYNrOWa5/ 5sJ8jl7aHptX/14c65N2V28GvM15cbW/vlyJ7XLsTyhB+vo9f7/B6BX5u694YMQy+K6v 2XFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0tlahbRUvfQT0uLaPB1Qbing+SwRJjiOGawp4DyD+9Y=; fh=Kr3IN6esmjNREfkbiMm8bL6RvF40RecC5yDEPfmNSiw=; b=TEqnYEunE0gk+m0QRvRM89kazDSKZpfQ2gg9+VHRVH4D2n9NLeJNcl53mzB6bgP6wI nBIOvNhtzHkS8Dx883zgVjlkxbpEI+oY6/w8U4LF3UC0Z7agf3yZXjWfAyH8ALFk31Q4 ITzhnTHi6BI63a0j/s33NB1CODrIibzBDgR4rnNNxI5YCzU+MPaYbm8LU7j4Dq+ukK/p Bij7iMNjHb4tpl+UXq6UqJ391fechLQC+8IC7aU7aMWefOylpAlW/h6DEp8n+HAymTrM 0gF/asFRrFyY1ufyGDnbQNvUwzhBNo0RhHs9U+ZhOwOmWaQ3BF9UJ8JNQleeUDeTcVZR SqOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nez1+jGu; spf=pass (google.com: domain of linux-bluetooth+bounces-988-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-988-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 26-20020a05620a04da00b00783044d1e01si1704215qks.8.2024.01.09.03.04.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 03:04:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-988-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nez1+jGu; spf=pass (google.com: domain of linux-bluetooth+bounces-988-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-988-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 A70071C23F34 for ; Tue, 9 Jan 2024 11:04:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1701536AEC; Tue, 9 Jan 2024 11:04:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="nez1+jGu" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2458B36AE4 for ; Tue, 9 Jan 2024 11:04:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4099PRlw023103; Tue, 9 Jan 2024 11:03:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=qcppdkim1; bh=0tlahbRUvfQT0uLaPB1Q bing+SwRJjiOGawp4DyD+9Y=; b=nez1+jGu49Jenp7YClEWgUTFGcjasmRuHGvn ZDxgrUUyaxs/oahKXrOvkCPJItC7m4OHqL7a+HtVBohL6q5Foe4zCDHC2ilp9blC Yz8PLEGpEAGHAsSEABIPeANTOKvmCTY8QyDPqQv5iZGflJM4heIwd3ahGonjWBma 5MKiOagveCczsfrI2p5f4d/6RjHP97/APSoXNzFymWnzR/p+gY0UB1KUQ1sc0PLo QPNJx4M7ZbFsrB4oKD4o7N/wSEnpprLUpfciza3/IjR6Cw153dJy+v0vosA3A3Iz SJUHPUqOHxRJfKDEEspo4l5gBLiPdki5z0h9iFMcW9LqnxhWGQ== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vh3g685m6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Jan 2024 11:03:57 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 409B3u1p000597 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 9 Jan 2024 11:03:56 GMT Received: from zijuhu-gv.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 9 Jan 2024 03:03:54 -0800 From: Zijun Hu To: , , CC: , Subject: [PATCH v2 1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR Date: Tue, 9 Jan 2024 19:03:23 +0800 Message-ID: <1704798203-20887-1-git-send-email-quic_zijuhu@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1704789450-17754-1-git-send-email-quic_zijuhu@quicinc.com> References: <1704789450-17754-1-git-send-email-quic_zijuhu@quicinc.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: cfWlv6xAe5FCmqslQWBdb0aG8mUrbvy8 X-Proofpoint-ORIG-GUID: cfWlv6xAe5FCmqslQWBdb0aG8mUrbvy8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 phishscore=0 clxscore=1015 impostorscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401090088 hci_store_wake_reason() wrongly parses event HCI_Connection_Request as HCI_Connection_Complete and HCI_Connection_Complete as HCI_Connection_Request, so causes recording wakeup BD_ADDR error and potential stability issue, fix it by using the correct field. Signed-off-by: Zijun Hu --- Changes since v1: - Correct tile and commit message based on Paul's suggestions net/bluetooth/hci_event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index ef8c3bed7361..22b22c264c2a 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -7420,10 +7420,10 @@ static void hci_store_wake_reason(struct hci_dev *hdev, u8 event, * keep track of the bdaddr of the connection event that woke us up. */ if (event == HCI_EV_CONN_REQUEST) { - bacpy(&hdev->wake_addr, &conn_complete->bdaddr); + bacpy(&hdev->wake_addr, &conn_request->bdaddr); hdev->wake_addr_type = BDADDR_BREDR; } else if (event == HCI_EV_CONN_COMPLETE) { - bacpy(&hdev->wake_addr, &conn_request->bdaddr); + bacpy(&hdev->wake_addr, &conn_complete->bdaddr); hdev->wake_addr_type = BDADDR_BREDR; } else if (event == HCI_EV_LE_META) { struct hci_ev_le_meta *le_ev = (void *)skb->data; -- 2.7.4