Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1935412rdf; Sun, 5 Nov 2023 22:20:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IH75lewVib12L7uJXyO4rvyqiStibs8ePWB2tx0SwcuS6GmZrqi1vTmE3UkphBzYX43HdWw X-Received: by 2002:a05:6870:3d86:b0:1ea:131f:5fb7 with SMTP id lm6-20020a0568703d8600b001ea131f5fb7mr31882087oab.26.1699251604378; Sun, 05 Nov 2023 22:20:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699251604; cv=none; d=google.com; s=arc-20160816; b=hIbj2ItqpzdcBwuGRH+EXD/sci4ucYoTHOoWK64aEbc9f0c3pKscWTseRsqb+rq/ci Vnw0u8B6Zf1g7daF2P/jfDPK/rL2PfcRJ7td4DNVREBKBFiZ68iE4DO2oBzQVvJdUBg5 z8tT3CLMESgLzilavVaqI1LH3NQBpUOv6VclykDHM9Ka3CiFk+ZHgcxZc4Po/JnAJgkb zddPuLOXw6jDY4ZKVR0WPDqZpmVXmG7fHKh1BcKumuil8+fsi+DFNvEbNvnEgB32v2nz Hse0Tt8fJphnWBVrmFYNAR/Yu2sFXy7ez/hkx8krFRaruuef4xS+Xo66QQZE5cXPBdwI 8okA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=IRqwXzWYKDpE55XOiiDsQRqxjpy7opdGeGkohcB1m5w=; fh=Kr3IN6esmjNREfkbiMm8bL6RvF40RecC5yDEPfmNSiw=; b=shvLYcDZ3OwkNGD92zeBARzKGjwNY4XPDpLwX5uQ9vIUPMBtSGjak/qzFlDqwbhhgR ZHFMjQZnEkhChHeBEonT/N5eRJOASOugY0cCYTiM156W5vaPdg2BM4l9FoojB+sZl8hp UyQazd4LO2gxjN3MU9cjjUUklCehoi0YO+3Jf8Z3fH2TkSK9WxFm2a25XfTB4/dVBY2O tiZROTtMpYWpAVofBx6k0hy4TgD+sm65TnSKkpy7wVl3IuD/KyNTfK9WXHSS5NrNR4J5 1tO2kMLpNJVjqElk00NIkgJHApgfPLb8JBKngOLGzxIM3Vmv+5dO1mnoDWyIuiWC8waE 8MGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RXyvluFU; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id e24-20020a656798000000b00578ea9a0b93si7306748pgr.890.2023.11.05.22.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 22:20:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RXyvluFU; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8A79A809C905; Sun, 5 Nov 2023 22:19:58 -0800 (PST) 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 S230420AbjKFGT7 (ORCPT + 99 others); Mon, 6 Nov 2023 01:19:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230319AbjKFGT6 (ORCPT ); Mon, 6 Nov 2023 01:19:58 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF426B8 for ; Sun, 5 Nov 2023 22:19:55 -0800 (PST) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A63JjSs032138; Mon, 6 Nov 2023 06:19:53 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=IRqwXzWYKDpE55XOiiDsQRqxjpy7opdGeGkohcB1m5w=; b=RXyvluFUCRVvnFCWhquNmi3NUZVgAvCy6Yc5Wxkgb9b4VENZ0KREUXTyNoftD/WERig3 56ZMmiznVoahu+6EPX6Jw3x+AdDB13nMWQQKQuOo+azRNzHl2tRqgUCKRYPYOV9iFQ0W NQUc0DKCAg22mKcuiENWjFQcGmO7SNhpa011mbgBDK47Qh86X1rB8Ezgds1HYArRPStS TJy0JHaI96GdJyLTlHsnBU2UwMyi/KZa4o9zsSlYPskiXr72y6MLI1xWBMcam3EHzf0C J4HIFkrOQxgIXNCbcmBAgHGnu9xifVporVTVPJN1SiCCJgdekjAipGngMcmJQkW0nUpK WA== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3u5euyu7nd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Nov 2023 06:19:52 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3A66Jppi025838 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 6 Nov 2023 06:19:51 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.39; Sun, 5 Nov 2023 22:19:50 -0800 From: Zijun Hu To: , , CC: , Subject: [PATCH v1 1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() Date: Mon, 6 Nov 2023 14:19:24 +0800 Message-ID: <1699251565-28759-2-git-send-email-quic_zijuhu@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1699251565-28759-1-git-send-email-quic_zijuhu@quicinc.com> References: <1699251565-28759-1-git-send-email-quic_zijuhu@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: y20HxazDcgL448SyktAvssMY43bGDtrY X-Proofpoint-ORIG-GUID: y20HxazDcgL448SyktAvssMY43bGDtrY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-06_03,2023-11-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 priorityscore=1501 adultscore=0 clxscore=1015 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311060052 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Sun, 05 Nov 2023 22:19:59 -0800 (PST) Explicitly add non NULL checking before calling hdev->get_codec_config_data(). Signed-off-by: Zijun Hu --- net/bluetooth/hci_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 2cee330188ce..d647eb4606a7 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -346,7 +346,7 @@ static int hci_enhanced_setup_sync(struct hci_dev *hdev, void *data) bt_dev_dbg(hdev, "hcon %p", conn); /* for offload use case, codec needs to configured before opening SCO */ - if (conn->codec.data_path) + if (conn->codec.data_path && hdev->get_codec_config_data) configure_datapath_sync(hdev, &conn->codec); conn->state = BT_CONNECT; -- The Qualcomm Innovation Center