Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3255599rwb; Mon, 15 Aug 2022 22:26:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR50mMXxB7keMGGRU/RnJeP0CfQPtOzRxXwVTqJYMb2nnIxrj1QqZBhkLikZ+W7Qyg+bfAuu X-Received: by 2002:a17:90a:c782:b0:1f7:a6cf:2f41 with SMTP id gn2-20020a17090ac78200b001f7a6cf2f41mr31502454pjb.128.1660627616305; Mon, 15 Aug 2022 22:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660627616; cv=none; d=google.com; s=arc-20160816; b=dhNJNutKtox2fJUSFA9UAC9CTzlvG5xUrV0afcoddE246rwbYQFdzkANF7Q2u57Ai+ 8Baa/eKqdKolWw96D/SN2/ENCZeutDVoOVq+D8Vrb2AA/YF/seMkr/771m4lH30WcqV/ 301GMLEgshf8eLPZUNQDDsdNgKLiJb9/VEhWa5UpKuA4PLJZDBpX+GoP2klMJk41zO8A RmPhiDY8LAVab5rmp+PIMgtoqbRZ+GRnsNye6/1iMe0NQayupf22UwnkHDMo8KSfYXlo aode1YHdE5O7X9qhIlO/AMmrydiyM96911zoSUt/9kALeSwXPinzrTucR+IAF2UW2Jui aYAw== 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=ndmwoxMFdsOBHtolpX6pcF4/Wg6lrjBgWPbnQDzJJJ8=; b=zgk7UUadfQET72SDHHCZfkJ6hjffnNbs1/p1TD3Sj8f6NIMo+fjRFkAZuYlUcHjZnQ ZVLYeKPJNnFHFAblam8TmVpDkvM1jiO8zaLIg+Ag4URLAj3zAlC0GhMcZGxi2/nxOLvP Cew+rXylrFUU/Cf6GfuBNgPFGPaAPL1TltQrhb77DvXNYZW8ROaOvuO9GpJbE2blPvqq OBlqV7TzvDlWEPny6dGuH9edRvnPy4rUbKf1EfGKHRJmQc5uch4yceAXZ3yWjADM2HzT MOVdGDJDavx+Rq+MSESMYaiKqM8QqM4ZgLmG42rewQmSdBJTKvlXEDkDlrZ3GQb5lT2k iPSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rYBX4Chs; 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 p29-20020a056a0026dd00b0052523d203a0si11214669pfw.77.2022.08.15.22.26.45; Mon, 15 Aug 2022 22:26:56 -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=rYBX4Chs; 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 S232391AbiHPEsv (ORCPT + 99 others); Tue, 16 Aug 2022 00:48:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232607AbiHPEpn (ORCPT ); Tue, 16 Aug 2022 00:45:43 -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 D654C61B17; Mon, 15 Aug 2022 13:42:22 -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 43A52B8113E; Mon, 15 Aug 2022 20:42:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99882C433C1; Mon, 15 Aug 2022 20:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596140; bh=n53XmxCgwLMlqFZN8KbH07lCxfM9RjyR4HTH0+4uqBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rYBX4Chsa1s/S5BPefboKoz8Q2oqz+/N3jc3rtfKR/vH/QT1AdMnCfcKr2l6XaLsh DyficWFi/45nk6ebI6qE6jGs6jSVugy7dW7U1n8DZ4xW7cFKT2KJWtPVs/5FMVcW8g aJtHtqC7ktNhM7mriVi5WAsSRVgp+iqLtu7gdJMM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Guenter Roeck , Wim Van Sebroeck , Sasha Levin Subject: [PATCH 5.19 0986/1157] watchdog: f71808e_wdt: Add check for platform_driver_register Date: Mon, 15 Aug 2022 20:05:42 +0200 Message-Id: <20220815180519.176030437@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 97d5ec548150764946f38632e62e79759832b54b ] As platform_driver_register() could fail, it should be better to deal with the return value in order to maintain the code consisitency. Fixes: 27e0fe00a5c6 ("watchdog: f71808e_wdt: refactor to platform device/driver pair") Signed-off-by: Jiasheng Jiang Reviewed-by: Guenter Roeck https://lore.kernel.org/r/20220526080303.1005063-1-jiasheng@iscas.ac.cn Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin --- drivers/watchdog/f71808e_wdt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c index 7f59c680de25..6a16d3d0bb1e 100644 --- a/drivers/watchdog/f71808e_wdt.c +++ b/drivers/watchdog/f71808e_wdt.c @@ -634,7 +634,9 @@ static int __init fintek_wdt_init(void) pdata.type = ret; - platform_driver_register(&fintek_wdt_driver); + ret = platform_driver_register(&fintek_wdt_driver); + if (ret) + return ret; wdt_res.name = "superio port"; wdt_res.flags = IORESOURCE_IO; -- 2.35.1