Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3009225rwb; Mon, 15 Aug 2022 16:04:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR4hcNbDPYUtkrR5vNC2cv9e2yp8R3kzOx25qb2X4OyhsilMXEjR9uZtXWAjN/Q0zUgWdXMl X-Received: by 2002:a05:6402:3687:b0:43c:e5d3:d50d with SMTP id ej7-20020a056402368700b0043ce5d3d50dmr16739730edb.174.1660604674786; Mon, 15 Aug 2022 16:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660604674; cv=none; d=google.com; s=arc-20160816; b=dUu2ht2WPDPy09Wc4RL7C+2ghHlwGCmRYCFaGak7ODl7fds74AynzLlCEG3PS0nn89 3R5gu/waK4yxqK2BXm2JXozKxExqHT3mkNHDNFnOR/8AjMr4AhPNpeJ36YQmY8k0WXYT lptb8py3/oPtkWShapPtiJm3cWsgRj3PN2UsK7ejY/1s8EJtQBAWVN8r1jH1F2aafMN7 V1srmh5a/BwgFXw2ezbU9/XCx257+r96plkobGDzASopA3gRnclqpZquFu3MOkH7TwSi 1SkzYpulG46OsUhtnOdIU2h9yt7Mnn1KJ2oZLXRKmSg0XA68gb/Oe2ES75gxuD1P3mfX Rd9Q== 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=I+Ff+vyjF1nhLsnkk+i/cctOzgDVp8FydAa3rS+AQ2Ee6zrOEcXOwVzqFkI+aIP2/V gnO1hH2d+YIJe0koH4Xl5wmYT7WYNLeJ6YWC8t9u2SGtjugW48XpcclVtSIVjF930yLT bbA2v9yf/tiSGXZOdsN64Z1H201lC3D81iY7w7ozMjBJY814XhbSSFLQdl9YCFeuL7jt 4Dz+sNkAQHeDdu/4TqbYuAHZfFqOxLmmhE9yIJcWXHxetoqvStQF2FcYs5nblYKblkt5 GN3gxkmMU2Z53LeOdbWlnsBFfnbIOo/LCi5JkS6RqwrCJ3TafZyFyQcBFFOynlqpsNbq dKjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XHfhGwCZ; 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 du22-20020a17090772d600b0072b749835e9si8675732ejc.850.2022.08.15.16.04.09; Mon, 15 Aug 2022 16:04:34 -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=XHfhGwCZ; 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 S1351769AbiHOWtL (ORCPT + 99 others); Mon, 15 Aug 2022 18:49:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351932AbiHOWrX (ORCPT ); Mon, 15 Aug 2022 18:47:23 -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 79FA5134B9C; Mon, 15 Aug 2022 12:53:05 -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 E41E861178; Mon, 15 Aug 2022 19:53:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB43FC433D6; Mon, 15 Aug 2022 19:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593184; bh=n53XmxCgwLMlqFZN8KbH07lCxfM9RjyR4HTH0+4uqBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XHfhGwCZC66ElinauN7Z/MJItsmlvvDr1QfHA8TQpfFheVOSxFyHlUlDcYiLigQFp oE7QTBLrvC7c1LKipf4yCIwO5lntM34O+18S+Zg9n56QRG4h3VyIqheRn6TiaMSwm/ gxlV9OAZdAy0R0sZ/JdCe7xKGzS1DxvRObbEv4aY= 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.18 0908/1095] watchdog: f71808e_wdt: Add check for platform_driver_register Date: Mon, 15 Aug 2022 20:05:07 +0200 Message-Id: <20220815180506.855128263@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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