Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp460198iof; Mon, 6 Jun 2022 06:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+yF059sKuI7WGj+8QHzL+6xczyaHU8NFphcN6YCpjqvEmOvp8QUaeN8hDhjSjj69zzW0s X-Received: by 2002:a17:90b:46c6:b0:1e3:524c:7f94 with SMTP id jx6-20020a17090b46c600b001e3524c7f94mr33204991pjb.177.1654523439353; Mon, 06 Jun 2022 06:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654523439; cv=none; d=google.com; s=arc-20160816; b=S3a53sYpoG4vDq14161U75X1Mvt+BjP6mdaV+1WOJUx/xwVl3fuRB4iPQnNH2/BUC/ sz9lgxisoHFer5PUZgOE2+0SZsXU/W/GOm+trnhk7x9eJr9Tqyr/T/fXvvddQt9Lee98 jUP9XX6jywaZgOPzkVN+HZ41xrgUr9M4DVHEeVcc+rG+LGrXBe1Hj1tO/oMn6L9jDhXc 2ssE+/5ng5B2Yc5s1+RcjhD9msxjZDrzEvN+mzA8Vs442Zed/818uN/E+6XAgIlLFZx0 7I+U8ggRM7figHU72iElP/aWOzeffBOXZM/VHKy+f3zUgF9DwwwfMkOT8KuZF1T1QZkk NKnQ== 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=sCJG1coX9MBJtIAeD1w1Hy8KGmkus4TRxNoh5Y+JtHE=; b=FhrSvoE1Y/oYjEOEElDLfPfZSFfCVToDqPT9jctSB6HkKflUOa/OoNLykIQ5707Tu+ wmF8wEZamjjzHDwICKKvqqchfPBUFqUys+zJ+9moFoKKVUhFyMdhx/G+PX8ItS57B1If B5fGqFOvtm5iJ9/VbPhvcmEEIVsEjbBuxG692ysPEz9+1Y9e2Ms/dZBx4QkWeOK3Yt7W y3VnTO2b5f1Jw4NYFl1b1W01WicjKvp2F/NmVnCEQBGw0F+q65RZIq0LmD/kXMOdObWx Lluoj2mfW6TPLAVmnI1apd8zo9uR6YL8x8Al4Tn/FsMyQHf6nmeR8fz4SImyNBxQLQCI au9w== 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:18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q2-20020a63d602000000b003fa4f566185si20207098pgg.384.2022.06.06.06.50.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 06:50:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F33FC5FDB; Mon, 6 Jun 2022 06:37:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238930AbiFFNhc (ORCPT + 99 others); Mon, 6 Jun 2022 09:37:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238926AbiFFNha (ORCPT ); Mon, 6 Jun 2022 09:37:30 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E81F1FF3; Mon, 6 Jun 2022 06:37:29 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LGvdj6G9czjXLs; Mon, 6 Jun 2022 21:36:09 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 6 Jun 2022 21:37:27 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 6 Jun 2022 21:37:27 +0800 From: Yang Yingliang To: , , CC: , Subject: [PATCH -next] Bluetooth: hci_core: Fix error return code in hci_register_dev() Date: Mon, 6 Jun 2022 21:48:07 +0800 Message-ID: <20220606134807.4102807-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 If hci_register_suspend_notifier() fails, it should return error code in hci_register_dev(). Fixes: d6bb2a91f95b ("Bluetooth: Unregister suspend with userchannel") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- net/bluetooth/hci_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index a4b4b3b927f2..dbddf891a4a9 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2646,7 +2646,8 @@ int hci_register_dev(struct hci_dev *hdev) hci_sock_dev_event(hdev, HCI_DEV_REG); hci_dev_hold(hdev); - if (hci_register_suspend_notifier(hdev)) + error = hci_register_suspend_notifier(hdev); + if (error) goto err_wqueue; queue_work(hdev->req_workqueue, &hdev->power_on); -- 2.25.1