Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3402443rwa; Tue, 23 Aug 2022 04:18:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR6/MgrdaOlZVtt3tiOez1yGieD5a3BQghS4VP48+vnKTEymOf3V4XbPP2Aw3dqIrMVw7hPx X-Received: by 2002:a63:4566:0:b0:41d:353:46b4 with SMTP id u38-20020a634566000000b0041d035346b4mr20727100pgk.316.1661253500538; Tue, 23 Aug 2022 04:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253500; cv=none; d=google.com; s=arc-20160816; b=ojXn52sTWukbYCvmACYWP7QabcvWbQmaTrCfSfF0ytAnNTqhG8GSKDdtwz4DEwE87g JG6JiP0IuP+L0DxBw5DzGTUks0YYcjGCi90KluRIlfBejzC6sjJYcSFjP1VstDHpo18p b00i3F0E++/yWzOQqcmj1J3lyGdzwaSCD+YaIH79g81sZZ3aUm7FhE4WaVQ0PmTo7qAe WZeqeWxVYMLC5mCvLCJz5Q7MLUmJA6qJga/k67sb2Uir86XVSrVv56kYmktdOUmVhMMC 3mbS/F5Gy4E3d3wfMPOaMMm8hBbtirHW6vfu9BbRLnm+YLRstLVMviSV2t9Gp8J4AMLQ gFRA== 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=BI99Hc9H1u/KmcVrlqI2O13srQB62Pq2RupwsBj63Mk=; b=L8mgnXKoijnrNlIs1tTML/KJNwnrfStkbLENq1QVMgtIISRJubjnb/V3+66mQEbEyX PRYDHZJ/Y/6sthYfTdyrADwnw5mh6zjgbzV08YCt3mUCl5h0XWVJ9v9SUt2f4ooZn86X Ah2eDkQQv8PcEHXqaxHXya2JD2lM25kw0Es31wtcnzP289DnnAQ5riv5YSWjHmySmzSV Pt3MNXWAieY81WmVSOtMP5FCOCU/p5r1EHEmcqSqS5oTrevKiC/gOG47/xEiw7atqomY vP7YJ0zLsafwvgvwvgqK3xdNz+pkEh9bARtq1dI5I6pJztw8zrQnqBvdKXQeWdVZm0Ox H6tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qsJjY1fj; 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 y12-20020a63ce0c000000b0041a23dd4f58si15859185pgf.513.2022.08.23.04.18.09; Tue, 23 Aug 2022 04:18:20 -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=qsJjY1fj; 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 S241629AbiHWJoA (ORCPT + 99 others); Tue, 23 Aug 2022 05:44:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352120AbiHWJk4 (ORCPT ); Tue, 23 Aug 2022 05:40:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 214327A50E; Tue, 23 Aug 2022 01:41:49 -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 D713761257; Tue, 23 Aug 2022 08:41:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCBB0C433C1; Tue, 23 Aug 2022 08:41:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244108; bh=i6FXr4E8XnfuMt9Ll0SUB8OusLyDbQ0jV4V7ZXzwMAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qsJjY1fjncRyJXOgFCWKU762V10KhkpguGxo/6vMJLo7m3ENUWoTkS/y3CJ7j6odr tq7MspQvSYhaThC99z5ZyZJpdVjZEpCAz/tyYneCy0dpRvyv2e27ZcEXOlH1XTg/2k SVJXKhy0mVxQrENYNrylSX9riHnZK5ohzvFne/d0= 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.14 087/229] Bluetooth: hci_intel: Add check for platform_driver_register Date: Tue, 23 Aug 2022 10:24:08 +0200 Message-Id: <20220823080056.829750151@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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 c75311d4dd31..cbe4a2159d43 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c @@ -1303,7 +1303,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