Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp7041321ioo; Thu, 2 Jun 2022 20:55:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOwT+Z2/BjSjQ9Dm5OO4Mhsg5KuJGKNNd6xbJCpWa3PGJ0YUbQUtcBvdxLdNsskkpa5s7y X-Received: by 2002:a17:906:5d0d:b0:6fe:b420:5eab with SMTP id g13-20020a1709065d0d00b006feb4205eabmr7077709ejt.23.1654228530107; Thu, 02 Jun 2022 20:55:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654228530; cv=none; d=google.com; s=arc-20160816; b=MOsNzllH4AyJsXLRE6dAYsLOJM3pELUKmgX5vj/x8cN2gVcSY4GpiaKUQ1dK2zU+w7 cGpQ/cjeUiD66aDZbKZUeGw+5bh7CYjp3jWAPdAb5ZENhSvULjnN89hzr828zVh8L6hc UvSipEfSz++xbEjDKTKocVZZjLzS4fjsPWvjhz2c1Q1PywYRJuPW2vR73AN93GJHAX64 MVQwWQgkKtYQjLxbkT9QO7OXrBXvNTqDCUHjSa+dOqxXzfy82Envf62WVdPwINCnoETU PwuxarAvPSXt9DnS0fvWEmf9K+RmxA+PJiv3ngGwv5XmWzaxgILheKaJznJXahMGwJF8 wrkA== 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 :message-id:date:subject:cc:to:from; bh=KVzESV67YhAbIlP4LDjyQA519bDmqIfIGlBuTiPtxqg=; b=0vjUByj0pcCVt/ktJpdD80YkR2zn31umFdwq3J3gZiKM94mLo0SCSwDm0tdErAUDnG tzFlikwXQQ6tOUgyaCoWQ0IHBT0osQwm0pFMrFeLt00+hJHD/Wc9DxHjWxKIgJeRUkeC AApC9YV7gmBe63+Hgi4bPg56QFSocHzuwkQSOA3UnVjBwAQa1iR4jDlbD2FeSH26RWCx b30f/ZBorf0e3CxY2jIMauC+l/aBq9SoxeDY3vJT5bM6oBBKl0yB3E/+5JqtZAcBHtcG eq1TUOjJlvo4PID8lfB/bNzX259vwjT+pBeDFOTthjPkSCNLYBrq8tMeErzI4bPKA6Gv 5D6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p20-20020a17090628d400b006feb8cc461esi5956329ejd.416.2022.06.02.20.54.47; Thu, 02 Jun 2022 20:55:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240805AbiFCBZC (ORCPT + 99 others); Thu, 2 Jun 2022 21:25:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235464AbiFCBYx (ORCPT ); Thu, 2 Jun 2022 21:24:53 -0400 Received: from cstnet.cn (smtp23.cstnet.cn [159.226.251.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0B3C03B297; Thu, 2 Jun 2022 18:24:50 -0700 (PDT) Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-03 (Coremail) with SMTP id rQCowACniT7YYplitu8TAA--.28879S2; Fri, 03 Jun 2022 09:24:46 +0800 (CST) From: Jiasheng Jiang To: marcel@holtmann.org Cc: luiz.dentz@gmail.com, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH v2] Bluetooth: hci_intel: Add check for platform_driver_register Date: Fri, 3 Jun 2022 09:24:36 +0800 Message-Id: <20220603012436.3332620-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: rQCowACniT7YYplitu8TAA--.28879S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtw18uF43GFy5urWDXr18Zrb_yoWDArX_ur 1rZa43A3y8GFn3CF1jya13u34Yy3Z0grZ3XwnFqFyag3sxCrnxXw1UZrW7t3WxWryjqryD Ar1DWFyxAr13GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbwAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr0_Gr 1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48J MxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwV AFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv2 0xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4 v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E 14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x0JUywZ7UUUUU= X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,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-bluetooth@vger.kernel.org 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 --- Changelog: v1 -> v2 *Change 1. Change "iBluetooth" to "Bluetooth" in title. *Change 2. Change "ret" to "err" in code. --- 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.25.1