From nobody Fri Apr 3 08:17:54 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6E46C433FE for ; Tue, 4 Oct 2022 09:30:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230492AbiJDJaD (ORCPT ); Tue, 4 Oct 2022 05:30:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbiJDJ1z (ORCPT ); Tue, 4 Oct 2022 05:27:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 070AF63E0; Tue, 4 Oct 2022 02:27:21 -0700 (PDT) Date: Tue, 04 Oct 2022 09:27:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1664875639; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wKfUZzfIrtjVXCIfq76XyIPzaIUD/jjuOiPYqwj0h0w=; b=yisaX2O5wqQlID2EjZPDTmt+uV/3VMmrAL0bxjkxecXDZS2wHo6eIX75semFff2c+BjDZE SwfKveT/gj4nfROqQNVZbPVw7b82p5YwPTqncM0h6CKO03jjIIvbjUtIZqev/AZpjy+jG/ hSg1RlC2RgwFRjM02ZlKwseFKNbTg5COhYs5RiYKKW5eKbf0W73exfkUGxLd9GJNuuv0JN i/gsT9DuklywF2mHSSrTk++R9f9wTJQw49MQONQz5TmfyxcmlUev4KF+a2TuUd7dWrKZbq 8ikudDSdh39Peb7D2gqHQ1Q9scwsSEt1ej5zf5mhJ1sRLvBC4Iqgz12+omEFHg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1664875639; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wKfUZzfIrtjVXCIfq76XyIPzaIUD/jjuOiPYqwj0h0w=; b=tCdBNc8LBsv1PYhnI0K3kLqSgM3lgvF4yrA9Ao2NTuAZl3lmYdFacC6DdGMTMf877LS9Rz K7pmuvK/1WOFQ6Dw== From: "tip-bot2 for Lin Yujun" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] clocksource/drivers/timer-gxp: Add missing error handling in gxp_timer_probe Cc: Lin Yujun , Daniel Lezcano , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220914033018.97484-1-linyujun809@huawei.com> References: <20220914033018.97484-1-linyujun809@huawei.com> MIME-Version: 1.0 Message-ID: <166487563850.401.15793422697828294118.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the timers/core branch of tip: Commit-ID: 0e2c8e6d769bcdc4f6634a02c545356282275e68 Gitweb: https://git.kernel.org/tip/0e2c8e6d769bcdc4f6634a02c54535628= 2275e68 Author: Lin Yujun AuthorDate: Wed, 14 Sep 2022 11:30:18 +08:00 Committer: Daniel Lezcano CommitterDate: Tue, 20 Sep 2022 10:49:45 +02:00 clocksource/drivers/timer-gxp: Add missing error handling in gxp_timer_probe Add platform_device_put() to make sure to free the platform device in the event platform_device_add() fails. Fixes: 5184f4bf151b ("clocksource/drivers/timer-gxp: Add HPE GXP Timer") Signed-off-by: Lin Yujun Link: https://lore.kernel.org/r/20220914033018.97484-1-linyujun809@huawei.c= om Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-gxp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-gxp.c b/drivers/clocksource/timer-gx= p.c index 8b38b32..fe4fa8d 100644 --- a/drivers/clocksource/timer-gxp.c +++ b/drivers/clocksource/timer-gxp.c @@ -171,6 +171,7 @@ static int gxp_timer_probe(struct platform_device *pdev) { struct platform_device *gxp_watchdog_device; struct device *dev =3D &pdev->dev; + int ret; =20 if (!gxp_timer) { pr_err("Gxp Timer not initialized, cannot create watchdog"); @@ -187,7 +188,11 @@ static int gxp_timer_probe(struct platform_device *pde= v) gxp_watchdog_device->dev.platform_data =3D gxp_timer->counter; gxp_watchdog_device->dev.parent =3D dev; =20 - return platform_device_add(gxp_watchdog_device); + ret =3D platform_device_add(gxp_watchdog_device); + if (ret) + platform_device_put(gxp_watchdog_device); + + return ret; } =20 static const struct of_device_id gxp_timer_of_match[] =3D {