Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2872557rwb; Mon, 15 Aug 2022 13:03:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR7UAbfV2ESdBXXki8NlL5nJ49S6cGIwCEtouwe7WDfvCK2nT7yPQ/HS38MZra4BWr08VGWB X-Received: by 2002:a17:907:1de7:b0:730:66be:458c with SMTP id og39-20020a1709071de700b0073066be458cmr11341070ejc.730.1660593791633; Mon, 15 Aug 2022 13:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660593791; cv=none; d=google.com; s=arc-20160816; b=sgnF6bd+hbPnChmswtHu40Q+1KFnE5Rmj03ySSIIRGLZ8XDtT+QjoxY0B5DZCfFGz1 eB8gwGtb14ifRs19Q1EBE0H+Dva4oXzDmUfPOAdNIK/FkbUeYw/OjgGMODKOB3wXmxdS paUQj80YjYx56QA5dWFJ4SWMUjb8mj1tvEra0Exm06u2al8HmFl7aKkWiBBPhiAYm9be mdu8+/TiqDzv32bFjxNoLlkZDtwxZQFqmCRziHcqlCfqLEGNGQ+r8MU5O5OtJfoK2FLf xTzKvGjCNFW18Fz3UIwe4NxQl5RGIjjdKUkobd5EdZyIUEYIy+384Vy6i+xb87tofzNI /KHQ== 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=jx3gy5junEBG6zXHcTFFCQupSZoZCImWjyGND+3aUozBS/Y3H5uCF8gONr1e9QnQqu 8axifXRUMFXmlIoiST0fVjKIDD95uStwQP2ED0QSRYU3RHFrcu0CK+dACC5hSjI00N+T J2yCkgKgwmG/QOelpaF+mZ281TR6SjwXkty68nehxDPAd/vaR1+N+xMbc6e3VRvoMtMs diA6TfCfcclGfaTXKtONS7LXX01N5ZMTnECA/579E+girq6zoiGWCUyvcovt6yGevRMe oSk36qdl9YgHHIel/5EcXnP6ca+B1bk1eT0W3P5P4ETZf8urNE7Ntq3u8ectdg2MDs3S sxFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Up/1Vk+9"; 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 dm12-20020a170907948c00b0073056870528si8168886ejc.888.2022.08.15.13.02.45; Mon, 15 Aug 2022 13:03:11 -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="Up/1Vk+9"; 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 S245477AbiHOTFm (ORCPT + 99 others); Mon, 15 Aug 2022 15:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245526AbiHOTCR (ORCPT ); Mon, 15 Aug 2022 15:02:17 -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 1E4E933E30; Mon, 15 Aug 2022 11:33:25 -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 2748CB8105C; Mon, 15 Aug 2022 18:33:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AB3DC433C1; Mon, 15 Aug 2022 18:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588401; bh=8TplkGd97N18pN9xdr3NQUO0P7WdvSM5cJZ6n9xVWmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Up/1Vk+9BU1uphqQM/iS3u5520owWz1j/5mJk3FK5dkSRdzAlteylCMUVZKbYYHbB 3okI4YZy96YFMUAqTV7U1U5Zk41N/sUhrNmImuGHH43VfW+hiCPQ5fjGGhFjuH6tZt 8K9Bb0pc9ztXBpaf50e7FW8J8qHhefDZ7hDE7Dy4= 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.15 361/779] Bluetooth: hci_intel: Add check for platform_driver_register Date: Mon, 15 Aug 2022 20:00:05 +0200 Message-Id: <20220815180352.668150891@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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