Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3270610rwb; Mon, 15 Aug 2022 22:52:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR5iVi/WRBD1Q9ZpQQF78zeL9aNPs86Z5Lds7mNJ5E0DmCY7ylbaNAB93f4Vv88FZc1Cs+mx X-Received: by 2002:a17:906:c154:b0:733:197:a8c with SMTP id dp20-20020a170906c15400b0073301970a8cmr12617503ejc.483.1660629135841; Mon, 15 Aug 2022 22:52:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660629135; cv=none; d=google.com; s=arc-20160816; b=bu/1XDV+gpJ5hRMtO7DAKBJzi46xFeb8YwsNPzeWtIOL6Tl6N2jfJcnmP43fup5zpN OrA55ETbwOZlNr8C9ne7X7h55sgxpbnOBKvKpszm4wNLSy3x7KkBrc4RUafwBpoI4sy1 BMTRBJjpytdiu1Va4DBGlOmYljbejhRcf7PY497ey+gJFvGnId+QxJ133r2r8oGZFt8f GqZICY+jQvsb/SfAoKUOFuMUnMShXH7n9od0UmGRMGZT2eO2P39p/ugmfjObS9cxkNx7 +XaTLkMHRujKySEjXov7lUk4CdpfNm5AhhVTBALGfCYY+NC7/M+Tc/ybl9vCtLvDETmD 99xQ== 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=VW3r6XLwimPAzwKQQwOLpzCeLYydTajkPNh7Qe1reUJPCcxWZ4jmB0rzm/UQuKSu8U ZqyLiUVTpAmgkQ2QwxgwphwuBcrU54Qm9VHfpxjxR603RYkYkMktxBdqrrI9AGN0Vk2n MtIJ7KO40WEMdKNwvU64fkEx8v+Ud9AoXtR/jQ6ysOoEtZfuybY4AqoaiGmWP1jP+NDw 49VlYDvswYN/WxcgoXAEAoEmk0infn6y9atVIM2+6VUR6XGr4wRog0RPTPYaZl+O0OG2 LND0RwQln0l7AoPwI3u1W+9JpZORX7HNcAtIHMPw6PDEDqA6YQQzxcdtkqaOmoQ4l7e9 YtdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2re7Nvuu; 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 a26-20020a17090680da00b0073075179ad5si8228348ejx.460.2022.08.15.22.51.47; Mon, 15 Aug 2022 22:52:15 -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=2re7Nvuu; 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 S230008AbiHPEbP (ORCPT + 99 others); Tue, 16 Aug 2022 00:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229815AbiHPEas (ORCPT ); Tue, 16 Aug 2022 00:30:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13BB015C937; Mon, 15 Aug 2022 13:18:16 -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 4D51660FC4; Mon, 15 Aug 2022 20:18:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59437C433D7; Mon, 15 Aug 2022 20:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594686; bh=8TplkGd97N18pN9xdr3NQUO0P7WdvSM5cJZ6n9xVWmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2re7NvuubOdaMmmGbDNpUb4aX9fuwP82f2rBB4GxMDvtZYodRW+f96NzcLcxFfMYp kZcvbZQYNf1pWG+rW+QYU86lbSMSQUCJnbDnePImhdnXyjFgbwI0N02WjxruWQlydV XoL4bHlfBBO7zjAbbzL0SHIqoV6cGXsoqkCjSP5s= 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.19 0527/1157] Bluetooth: hci_intel: Add check for platform_driver_register Date: Mon, 15 Aug 2022 19:58:03 +0200 Message-Id: <20220815180500.748974119@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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