Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2267716iof; Wed, 8 Jun 2022 00:57:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6EnlNv1HQ27HoLolPIECB5OoaqgBfko8seBq7OtfKiX3UP7QXs2SaDNtmKVzl9yyV+VxS X-Received: by 2002:a17:907:2cc7:b0:709:f1e1:7b17 with SMTP id hg7-20020a1709072cc700b00709f1e17b17mr29412417ejc.498.1654675034792; Wed, 08 Jun 2022 00:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654675034; cv=none; d=google.com; s=arc-20160816; b=UVYJP89lTgAzIESROvFdQ4atCcWBDfjkuARFHS+YHRzNfWJaTUgaMkIeS6rmzR6rX9 lm3nWsSzo9RLdkKjDMp88LKNpVrj83eEU6yXzkqEAKAliF8vdsRa2ec8F3gXQNUS3pfB 61wAA91NRlCwxA0TmOhHRvW+6lVwbZbzGHjtW79znJYzczmT04eLGaOl51bIVyI9GHOx xerwotJ+O+Y9Ammof7dhHzM7dD9p5OOXrzZhD+e12KdGK7Y04MOqBsbwCvc6SzGzbNLM D9lu6EHWhcA4XNadUz1l/bdt8pMAC6PEj/3h5EKeND353kB0cGdz8flk/Mi9/ucQRukF PdQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h7/f7vZ66gEjFZHCJ3qWURH3TIOtC/rQQ34GP6rECZU=; b=JiEcLoNtI748soGDc7hZGL5tKF2Pwy9/FlNJj7X5OSa3jq6eetLOOEx/gKxDuthrLf QrQ6mDPXDlnkuGeM+8BnlJlID+NGrwetVa/GxAmKUQSQdzHs08S/szNy6gh74l8wO1cD Le9VoIN+foP3ibJOtdLfgoSsZ8rpJ7LOGpAbTo6rVk576bMKQEa26s2tSwryUor8Y2wv 0ZBAIYfW+PUbmNVd4S4AFQjnUXvX3BcaOoy7Ge/5oyQtzac2OGOcdrZRVOkzfRVWXv76 34kPaBFgTiLK3208xS5nfYKg0au/dd3zppELV0GvcJM2QOT3oJQLdUBeWvMa0a9A809E MBag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YoeSCJOL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by6-20020a0564021b0600b0042df8161c98si789097edb.244.2022.06.08.00.56.49; Wed, 08 Jun 2022 00:57:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YoeSCJOL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386219AbiFGWsl (ORCPT + 99 others); Tue, 7 Jun 2022 18:48:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381296AbiFGVk0 (ORCPT ); Tue, 7 Jun 2022 17:40:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 732831A1955; Tue, 7 Jun 2022 12:06:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 086A7617CC; Tue, 7 Jun 2022 19:06:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C48BC385A2; Tue, 7 Jun 2022 19:06:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628777; bh=lCSjziNxTNEwSEtrEq7GooJbluSq6XU4T2ICg7uY5No=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YoeSCJOL00lg3V1or8os+JYaeh+EpqVMzZD6GxHQZi0YgOc4Bej5njK0q7eZJsEyx jwoo4erf1bDOuDu0BOGgcykL6n57ard0yETXwo+vBu7Zi2ZwRU2TykNeMllnITWvws y2JVRjgsFqQrfyQCoW0/OskL+4vCGMSyyTuWxAXU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yake Yang , Sean Wang , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.18 451/879] Bluetooth: mt7921s: Fix the incorrect pointer check Date: Tue, 7 Jun 2022 18:59:29 +0200 Message-Id: <20220607165015.959413495@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang [ Upstream commit 789f6b8ac3b15bca09b69d5699cad0bf6e2103aa ] Fix the incorrect pointer check on ven_data. Fixes: f41b91fa1783 ("Bluetooth: mt7921s: Add .btmtk_get_codec_config_data") Co-developed-by: Yake Yang Signed-off-by: Yake Yang Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btmtksdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index f3dc5881fff7..b6d77e04240c 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -961,7 +961,7 @@ static int btmtksdio_get_codec_config_data(struct hci_dev *hdev, } *ven_data = kmalloc(sizeof(__u8), GFP_KERNEL); - if (!ven_data) { + if (!*ven_data) { err = -ENOMEM; goto error; } -- 2.35.1