Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3088364rwb; Mon, 15 Aug 2022 17:50:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR5EQnF8og9Q4gp6gL6mgJZTroqBGacIzFNrOpIgDffbgsEHpWOuIhijY5Oj2ZDiIQDOvtgF X-Received: by 2002:a05:6402:1909:b0:43d:d495:5eff with SMTP id e9-20020a056402190900b0043dd4955effmr16308634edz.397.1660611042151; Mon, 15 Aug 2022 17:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611042; cv=none; d=google.com; s=arc-20160816; b=p+6O4TBYOpFI4N1JF5XLcXltjPlUMKrbUhglfzIXaqyDSdQktT5vehNDOjDYQaiRyO PewIFLLviJUP0cxoTnnw/U6TSXTzmX5Z01Urg4awYHb71g5rmzDF6vkNn/LdpT9bgU5t nGD3j7fffpacOGBQv2Sk994+LZka73p/dETjltP7RhFKjQMpN1OUydebQOQz0ZklDjCY 8FQYVUdsWQnMZpozaBpnFuF7jykoA/9yADUzvszIwN8Ug33jmTqScbhChoI/1A82zXpE 35FizmOu9K5JE3gtwcHrvgMZpS2wm63SHI33om7gqcoD44O3kJX/W46foUMQoH+jjDCF zweQ== 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=u4Jze21qgF3jnJAR3SdzxMYPA/ujA3DSFse4WNiYrVA=; b=iuJfGmyszKtMKWsGAns2ojR4Pg0Z5uStXEnnWUnb9mbPzo3DUN+5bSWh5cxvDf9f8A x34yVOiO1vGb4STl5qECBe+A0IgQhMXhFeMELe8SEUbtuRNq7YCqZDRA47ECI6DeSbpf VUP2COzAUV7qWpwy3uEAXW4K6hutL/2g01m1UjJJnzOrl7H5wsPFe/WkU0nt2mh/Atch bIKdhM6BuAwmJJbi/M5LxCZEQloCnjaUAcQQdLkumN+eSoMVlpPuoF49xfSGDmxMKHgQ w6ZzwXSUMZ95VIlcrIsDFppXH6HtiTBT2mDH4rBbu+B/LvLdzKXaaZhxHVz4O0jRG7kx WMvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dco02L13; 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 o11-20020aa7c50b000000b0043da70a82f8si8715120edq.117.2022.08.15.17.50.16; Mon, 15 Aug 2022 17:50:42 -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=dco02L13; 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 S245648AbiHOVUw (ORCPT + 99 others); Mon, 15 Aug 2022 17:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231867AbiHOVMy (ORCPT ); Mon, 15 Aug 2022 17:12:54 -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 97E02D9E88; Mon, 15 Aug 2022 12:19:38 -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 F3F5860FAD; Mon, 15 Aug 2022 19:19:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE307C433C1; Mon, 15 Aug 2022 19:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591177; bh=8TplkGd97N18pN9xdr3NQUO0P7WdvSM5cJZ6n9xVWmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dco02L137gEjscKqSamDkC9myKKXkcfGKh2vsojkonO+5/VvbOa4Em3Z+OwMliZq0 q7ieW99x9K/lG8qV94xsNT2Jsyq/CCEe2VDiBiBI9KhWcIW3r/IU4kT39hK7VfXxkG b7xbn9iW3fyOTUVfgHhwCh6vOlYkFFCzolTYajJY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.18 0495/1095] Bluetooth: hci_intel: Add check for platform_driver_register Date: Mon, 15 Aug 2022 19:58:14 +0200 Message-Id: <20220815180450.002752306@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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: Jiasheng Jiang [ Upstream commit ab2d2a982ff721f4b029282d9a40602ea46a745e ] As platform_driver_register() could fail, it should be better to deal with the return value in order to maintain the code consisitency. Fixes: 1ab1f239bf17 ("Bluetooth: hci_intel: Add support for platform driver") Signed-off-by: Jiasheng Jiang Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/hci_intel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c index 7249b91d9b91..78afb9a348e7 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c @@ -1217,7 +1217,11 @@ static struct platform_driver intel_driver = { int __init intel_init(void) { - platform_driver_register(&intel_driver); + int err; + + err = platform_driver_register(&intel_driver); + if (err) + return err; return hci_uart_register_proto(&intel_proto); } -- 2.35.1