Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4419884rdh; Wed, 29 Nov 2023 00:30:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIa/aFUMZzPmG86bBpfEVS90jy/M+bFFr60XcnMoOlWuBXIyeRUH4y/i20Pqo7oN1owD8y X-Received: by 2002:a05:6a00:2d07:b0:6be:2991:d878 with SMTP id fa7-20020a056a002d0700b006be2991d878mr20188848pfb.15.1701246600958; Wed, 29 Nov 2023 00:30:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701246600; cv=none; d=google.com; s=arc-20160816; b=oFSskTkDvHl3Qh9LNXGFJRYQ3VWnOBnkiXgNPkjbwX/6BbSAlpziZu+Qg2QhBWihEC as8PdpamJOvZFTSlwTyaCDh0n94zb7S0foMC4gyXwbT0Bi35MzHQmDF1Blb0wrkdOGZj 5Ro2wjaOERCcsbF3xoHUiAyuEEJDbE8qmHCsxUkBLY5wMw+rAn9B7PeKzo3F8CSePBeQ rkUmWDZyIbiv18zAxURqKp6XX7//D+QkcdFpsk5q/q/u3dlba4j18ghtx3hu9+Ok4BTF i4jXD/eZUhfqzNShP8J4tVDMjOfHFrihd/nt8HoUMq1VX9J73tKIJiYGyxG6fIKdFk00 6BGw== 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=UdXxIm20CMp25OlGrffrUgJTYDUDbBe+vI4+30bSar8=; fh=BdtV4WWvdeOOMk2W4ImEsw3PhwepPbDG8b+UjxYkMiE=; b=V95nR8qGvI7D6rjnDm95WsPtaGRBK1cYUX9jzYTEztBmeS12z5yisYuFTKocWSASFh 0Lqy84BRKmmslj247WJwaCxJ6EIC/g4rNhrpXLeAxGipilzLt8dGYV+2CAouCp8IGzUH 2/oYPrY4vB31WoOlr2nMUxoSjOlJeyVx+W9Py7wTa1w0ol7s9EsxtlLez4wWGYKJUAzY 4jHhl181ZqI5itpyZqSgG1awTxF/LLcgwFt+3P5exnRDz+J19fHZSJpaATL2h9tyYIf6 wt9ZOBGerdVy5ytXKFpUeWqY31dIQLEVmZZNgFaw0JOP9KEBEnA7hX6/fE8HV85ZjLo0 oiOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=m4QSUpOK; spf=pass (google.com: domain of linux-bluetooth+bounces-286-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-286-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k21-20020aa788d5000000b006c4de45c6d9si14071815pff.104.2023.11.29.00.30.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 00:30:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-286-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=m4QSUpOK; spf=pass (google.com: domain of linux-bluetooth+bounces-286-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-286-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9CD5A282779 for ; Wed, 29 Nov 2023 08:29:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65D6012B74; Wed, 29 Nov 2023 08:29:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="m4QSUpOK" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17188212C for ; Wed, 29 Nov 2023 00:29:41 -0800 (PST) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AT4jKOG004062; Wed, 29 Nov 2023 08:29:39 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=UdXxIm20CMp25OlGrffrUgJTYDUDbBe+vI4+30bSar8=; b=m4QSUpOKLSEdl+4Bfx8EK4gr36A+WJ+f/00thMAnhvV/zbIJC/Jo7H7kpxzJfpNu0gij H2AYrwNarrMMy6s7+q4o4WK3/r6Ix1PjELZiDp6jSId7LB1Nq3i5y0pN59akglhtxzer CjH1Z7H/JSLhwtQh/YFegYHZoXXCzfK7q02ozqLHQkWSqXAEwAxMuYFFfICHJsgi9Q6/ bVrCoQ0Z0c4i8j4wFf6v4MhJAnY4+HvhxtkSq7IXd4G0TDJpkEunrfNXRNyHhaH8IOcB E1SaQi5VghAv2Z/WQfjbdBdrQYKqLGGa03cgkt0qAFo3mo42qjxWNa75555WYReih+na EA== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3unvetrt6w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Nov 2023 08:29:39 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3AT8TcpH008536 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Nov 2023 08:29:38 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; Wed, 29 Nov 2023 00:29:36 -0800 From: Zijun Hu To: , , CC: , , Zijun Hu Subject: [PATCH v3 1/2] Bluetooth: hci_conn: Check non NULL before calling hdev->get_codec_config_data() Date: Wed, 29 Nov 2023 16:29:29 +0800 Message-ID: <1701246570-3564-2-git-send-email-quic_zijuhu@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1701246570-3564-1-git-send-email-quic_zijuhu@quicinc.com> References: <1701245906-10660-1-git-send-email-quic_zijuhu@quicinc.com> <1701246570-3564-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: 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: 7-7bU_8SXT0hx7MHQiTTJoMtVpqruLjl X-Proofpoint-ORIG-GUID: 7-7bU_8SXT0hx7MHQiTTJoMtVpqruLjl 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-11-29_06,2023-11-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 impostorscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311290062 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 a09071059214..21b59d674717 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