Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp692535ybk; Wed, 20 May 2020 09:34:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2pwZ29xUT08E2ROblt8JVRfzpIruZx2DRedPQezvDf9/2YESCC84yBQyosCRWpBQ81xy/ X-Received: by 2002:a50:bb6b:: with SMTP id y98mr4168393ede.296.1589992494660; Wed, 20 May 2020 09:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589992494; cv=none; d=google.com; s=arc-20160816; b=gBjzUmwhc1sjg4Yb6kUEbfdu4HqO5o1QhlXhll9K+dAmmm37XTO5KJtUkqA2/uYhGs cIZ8jrBnF+sL/QoYY0Olnd3kbgpa8OZObpVana951P6nbVsCoxFVg+d3LhE/xXMFmKDs UMGV1ihDS8cVFxH4xjoiePU+g67ibuFIIT5B94tBRuhjUfbp/n65brANR110xBOU6gCg lMP6MqkEQr0n5FjCttU7fiez/jxVABOV73DDCpg1ua5M00uY8ec3CH0FPrxuqdF+Wd+3 zkbtnUD91Jsf86vo5Nr3j0hevdIrl5m8zQaIs6qbR2mbgcuEV3umGSPGMXOKn3AfjEdP 8zWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Eb41g2AQad/byf93tKxgnf75XG7RNiTm+eUN7CnVN4Y=; b=USxOQCpZstIXf8hJ2Q6Fm3GP3+I/uIGLeXDssEM1C59xuEh3wLVoZZn+ph/cPfhMBP V480GEYJHwvb7dyL/aAQi0BC1tX6XydChNmI6eHaJZMeyF7aNxMq2TeLx0gXLckQ9FUE zNI8QBiefIHw/o6QuIokuRHZe5Hjbg+HaBbdm1RoTFtvb2FtdBfN+d1Sd4cnbs0wyfnb QeHS0eMcU7pdvBKIka4XuwFs8Ldicgj3NnOXnYamdOGsGM6bcP8t8lgGZpsV+B8nIGXU xu6EsUukZUhi9p7ypSFGDWp3+NDPA7UwlMKxiyf3hvlaJmFGU+S0qg/hGewswBlm2bss 23qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dHBIRx0w; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l10si1718633edw.270.2020.05.20.09.34.26; Wed, 20 May 2020 09:34:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dHBIRx0w; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727905AbgETQcp (ORCPT + 99 others); Wed, 20 May 2020 12:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbgETQcp (ORCPT ); Wed, 20 May 2020 12:32:45 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BA74C061A0E for ; Wed, 20 May 2020 09:32:44 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id ci23so1556538pjb.5 for ; Wed, 20 May 2020 09:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Eb41g2AQad/byf93tKxgnf75XG7RNiTm+eUN7CnVN4Y=; b=dHBIRx0wpM2xPNmVoPIb1MI54tyUz4U0r9wZNgrRDJWNV61AMhQKsEJ58rB/1ir/iD FPiWFAnqxut8ERkHSt4eacFJaoXHkdCyo7oq7/+ZPicKJx0FDdGJVix+TjKCCis3yzwU 6mBFCM4rN9d4a6+hTurOvL4Aep2yJwl4r2Puw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Eb41g2AQad/byf93tKxgnf75XG7RNiTm+eUN7CnVN4Y=; b=Lz/257FLcT29z/chh8z5i9plLvHbX5C8cIPcBBPmtLfpJhN/iXOfKYOdD0Ti3djisg inJxTzzZr7iRmwMM/EleH2fXSwjo1rffHh6V0XckwFuMKWY97HjR0NZg6lSDwrWhK9oH 4q7xPqoxfLhG7fpgL927hcOls7lRoBKKaxrALM6AfqkYZpld3hf/nyX1fZsqKMbsUbs1 ETBCRsl1jnR/pLLt1kN5cQoBXGEQ9AJ8b2BTMcqw5Xp3jmKv2wCKia+GbqpAZCp8AK8s 8LfdukNKyh5UUXUTWoHC8tCD1SL79zotM+VHQs8RarEA1YWKlRwft6o0YVeSMXNkqrfN V67g== X-Gm-Message-State: AOAM5324ZdOpwjWMGyWXC7lpuMjw3qBq8bjIZQ/bw9FQdalRBJ9tHxYp 4qeojFBOjLa3e+5/FWMX0P4KlQ== X-Received: by 2002:a17:90a:8c01:: with SMTP id a1mr6547868pjo.127.1589992363972; Wed, 20 May 2020 09:32:43 -0700 (PDT) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:e09a:8d06:a338:aafb]) by smtp.gmail.com with ESMTPSA id n23sm2349648pjq.18.2020.05.20.09.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 09:32:43 -0700 (PDT) From: Abhishek Pandit-Subedi To: dan.carpenter@oracle.com, marcel@holtmann.org, linux-bluetooth@vger.kernel.org Cc: Abhishek Pandit-Subedi , Johan Hedberg , linux-kernel@vger.kernel.org Subject: [PATCH] Bluetooth: hci_qca: Fix uninitialized access to hdev Date: Wed, 20 May 2020 09:32:28 -0700 Message-Id: <20200520093206.1.I1a56163c173e14d1cc7a8b639147466171525eab@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org hdev is always allocated and not only when power control is required. Reported-by: Dan Carpenter Signed-off-by: Abhishek Pandit-Subedi --- drivers/bluetooth/hci_qca.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 26efe822f6e58..e4a68238fcb93 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -1947,8 +1947,9 @@ static int qca_serdev_probe(struct serdev_device *serdev) } } + hdev = qcadev->serdev_hu.hdev; + if (power_ctrl_enabled) { - hdev = qcadev->serdev_hu.hdev; set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); hdev->shutdown = qca_power_off; } -- 2.27.0.rc0.183.gde8f92d652-goog