Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1861247rwb; Fri, 19 Aug 2022 10:36:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR5PXePeFGIYy3tgmaxATcbv3pewqGyFb6261vcAAmjGfcddkX5HeAu7ems/9SW3yJ8E4eiU X-Received: by 2002:a65:5504:0:b0:42a:352d:c79c with SMTP id f4-20020a655504000000b0042a352dc79cmr4614851pgr.58.1660930563756; Fri, 19 Aug 2022 10:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930563; cv=none; d=google.com; s=arc-20160816; b=ekfQ1PAo23BFNUm+X69jTmchNcSLIrz3xLx/OSIroJlCB4PPc1HcIOlM0NwjYxUmPM conVDOmDUZtN5Y55/bemxUwp71zztKUAdim/2B9oMkloEp9pqcBLdbkJ5xQzZd2J16wy 5u5P8BgmNdHU1Q0UKkqMReTA/OQkeqM7ZqmXYRqeIOEVwgWgKnovpnx2aR5dUWIBpUkj MME9M1QakobLAgPkh4SwmHmyyJQ3ZvhDhz8Lxv4mwdJX06PLLWQskgfaH/W9lNxEOzVx 2gQQcgjhamxbDjPOa5qKlnCYNPYkHP20WDtq4ijJAZAFwwIBYNa9tI5cJO02XeD/x/v7 /84Q== 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=SN+whpRL/4qOwaLp4zhsthfn46OXxBGlilKhcsUKKho=; b=wRDhWcm8i7I1Ua4xs6klr1IwzOuXD8IIQMsnKXH6K/0FjbynnoE8RlCErhcfqi9Rt5 qJODiPZhL+7RfgaRrf0gHs20t/n5EQfSfctIOvPPlqIQhg1YErtXwhjXxDfh5Hs+Si34 5Xzxg9mBDMilKYpEvo9pOf95zS+kd7kZyNVTvRObBX27A99rJ/9lTEs/UxFYelcS35Jh xdGqQKc7n8rQlc2jR+wKynV3Kk0DfX3peWliJJNnEzNjOCNw00QH+HRies2ww6xL7e4I zWvWUlAx/CvkgUm0CflCjxuQxOQyCAmpTgbEyFCYun4nXSvkGjwDgOqhqlevN6LTJD7N ZRZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DhLMD8Dl; 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 ke18-20020a17090b339200b001fabf75e140si1711129pjb.28.2022.08.19.10.35.53; Fri, 19 Aug 2022 10:36:03 -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=DhLMD8Dl; 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 S1352215AbiHSQV3 (ORCPT + 99 others); Fri, 19 Aug 2022 12:21:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352463AbiHSQQq (ORCPT ); Fri, 19 Aug 2022 12:16:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F4641160A5; Fri, 19 Aug 2022 08:59:57 -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 ams.source.kernel.org (Postfix) with ESMTPS id 3CAADB8280F; Fri, 19 Aug 2022 15:59:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9665AC433B5; Fri, 19 Aug 2022 15:59:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924794; bh=C61K24rBrj/U4o+Uq8gi+BmJc7Il3MbtnCWIPgG7VdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DhLMD8Dl6N1tMbydI8S89HqgR5gCcMXotDLQD5H1QYekpxNandAly1W8UfVsYvIxM YuGBaiGXMeF64mReoe7OrBXenwVO8JiCQc5ejxb/d+XhsOpNkJgSYTbZvH1dQAlY2u RPP1USX7+Ou/JiGX3lrUHvIqvfGy+u765IrIuwow= 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.10 245/545] Bluetooth: hci_intel: Add check for platform_driver_register Date: Fri, 19 Aug 2022 17:40:15 +0200 Message-Id: <20220819153840.320651183@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 b20a40fab83e..d5d2feef6c52 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c @@ -1214,7 +1214,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