Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3412813rwa; Tue, 23 Aug 2022 04:29:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR6aaxsHhbNXeb20Ez8T+QqdBh/a+HbsyaW/Evd1hjWIvmoYAP0f6GRGUgLl5y/DyuNHY0rk X-Received: by 2002:a65:458c:0:b0:428:ee87:33a8 with SMTP id o12-20020a65458c000000b00428ee8733a8mr20651758pgq.272.1661254144055; Tue, 23 Aug 2022 04:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254144; cv=none; d=google.com; s=arc-20160816; b=GImWYdrt136ndblPS1eKWl0ho/ZiYTjryOZbPafdy4hQTiVZF3Yw4gbeh05efIKMsO YSQnXT4ZM1EtrEcJ1lP208RCIfdJ1TnIcneQVqF7CF/VkGYYXzCp1XvFf7Xl0B8JTPlY Xdr5Scm1P7tGXBaoVo7SNdh1zEyBbTJDTxoLyisQ/0damgLT/r+VdmW3v4nGoMqPuURP ZLx0bFJ+eIDYWWfalI7zxGoD5xCVc1ylfHGSjK2gd1cJcuN8AO+V/js+xGZVrrP3BCgA DikZDH4RlTeDMzQHJZNHPk3ZwrfJqhPZcW5tDVflxAwjKqwuYepSLz5w19DoZs8vZvXF b8WQ== 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=7HmHdmFxNXmASFgykdqCf4IZYtLhiTMuKKePqNBl78s=; b=WkqUzOfuipMd/RoEF5THiIXZYVT8ia7oSz0LIvgsQpeW9WtOD/ZNrBA+cMmS5yzHfT frS3D5aBjSa5DQOhM4TNH/qT1c4bCicKpqRer4f1vA6zLtyXSGv6rBZnxIu52C5G1+L8 YmbM7THTOZyToCiql1Nv8NQyYnOs+eg63OpM+Ea+vOBQLHTux2AgPx0WppimOLq8ObRV 92vfYNEoY2dG5ZZGiJ3w2smBBx/Pmnrscn5hd8bEO5JnHilU5qiHKvbBRrt6SJ8Iwkq6 r6sM4ol7xiDWI8i/15HWPp2Kb7Bv7elz+CROpvH7oPMF0eK8CUxwpJnae/wdcrPBrUvY 4GmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZjUQYCAP; 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 142-20020a630394000000b004298f3fdcb6si16491665pgd.353.2022.08.23.04.28.53; Tue, 23 Aug 2022 04:29:04 -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=ZjUQYCAP; 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 S1356389AbiHWKmH (ORCPT + 99 others); Tue, 23 Aug 2022 06:42:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354826AbiHWK3c (ORCPT ); Tue, 23 Aug 2022 06:29:32 -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 7ADF3A50C8; Tue, 23 Aug 2022 02:06:19 -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 269E7B81C65; Tue, 23 Aug 2022 09:06:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5193AC43470; Tue, 23 Aug 2022 09:06:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245576; bh=lAUp43C3JTUgYhZPYiP1jP9u7t9uEzm6x8sRKe7/Weg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZjUQYCAPB2lyPjC/1BEFyIcLcjlZ+slzRrl8fhYPSyi7fQnSzsdW3fVw/4tB/q9R2 1l/HtpydPUM3Ftom4vAYj+OquVdUDHsbfQs0YkybBtdSdyOvTciz9M60ylOImlpV9J s03PxFGocCugL44xzENwwxeIx7xSn0eE1zaOpufU= 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 4.19 104/287] Bluetooth: hci_intel: Add check for platform_driver_register Date: Tue, 23 Aug 2022 10:24:33 +0200 Message-Id: <20220823080103.882935359@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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 e9228520e4c7..727fa4347b1e 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c @@ -1253,7 +1253,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