From patchwork Wed Nov 16 09:49:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 20854 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp58407wru; Wed, 16 Nov 2022 02:12:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf4H2cJz2Rq5SnkULCjlP4Cknu43cOB/56iONk0EIWZEx+o/9WmbQVgw5kj6U0LmWkYXpwWW X-Received: by 2002:a17:902:a70e:b0:185:3659:1ce9 with SMTP id w14-20020a170902a70e00b0018536591ce9mr8065460plq.26.1668593554623; Wed, 16 Nov 2022 02:12:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668593554; cv=none; d=google.com; s=arc-20160816; b=oE5mQFGQivUSvfCpmcX6KuR4vvN7nleMG6fFPB4+4VmIWxyAv/Prgg8/tSjS3il21o TaPRIR7+Rgtzs1BqMoljZQyuWMAqemcWMSQSnHfA6vS5zq9/pfAocmDyCknV3+9WQQnU JiOi4o+Ev1JIvYSSMmm3gTKca2jYXfQRvRIG+WR/peCI26TwVlkIRxCkE7IqyExdFu8m 7AyJg/fucPnhxx6q5ljQ6+FU5AMAc8ZPYPRi5ft0PmPvDwILUPCg4vzJ8/KbhH8omOkm IQvgjhR1eVr1zACQw5AizaOmJv9caZrKbagwtS8wpjM3BkfkVnFFnHQY0ffrQPS5Qp5r 29qw== 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=X229z4ODrd5eaYOLEE39UWuvp6Wy1G1fPxvWgz9IFQI=; b=mksh6St/8ioCZr7M2mQ+2qobpZ+RZ5bO8e5CAARj8h1gK+inom0XkijbVIPzqORAqh 5q2MdBG/TxJolKKb4aYGGa+5BP90ni8BLiou7Jz8kDmwBBNjIm3ONvIZ4gSJplRAdkMW yfpVsNqKorOnta17QEy/HqvXqylXLpXYBeCYlq1zYezd3luQ0pjI+HRG8Ese1gIrSvD+ +WQLGThpt2mldb1FBCrvpWmHNOTbJN6eHXAtycDyq10VgY0fPSEgQWL7aTVwymVEHIoo fwvsSjEitec8p9bvy0pSEmYRrv53FTYzprQh6r6SBEvYv2cn0PN8XKMR5ra6/r26sZ7R kW1Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e23-20020a62aa17000000b0056cb8f6f027si12945432pff.357.2022.11.16.02.12.21; Wed, 16 Nov 2022 02:12:34 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231622AbiKPJxI (ORCPT + 99 others); Wed, 16 Nov 2022 04:53:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbiKPJxG (ORCPT ); Wed, 16 Nov 2022 04:53:06 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BC47186FB; Wed, 16 Nov 2022 01:53:05 -0800 (PST) Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NByvQ6tXgzJnjC; Wed, 16 Nov 2022 17:49:54 +0800 (CST) Received: from huawei.com (10.67.175.83) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 16 Nov 2022 17:53:02 +0800 From: ruanjinjie To: , , , , , , , , CC: Subject: [PATCH v2] watchdog: at91sam9_wdt: use devm_request_irq to avoid missing free_irq() in error path Date: Wed, 16 Nov 2022 17:49:50 +0800 Message-ID: <20221116094950.3141943-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.67.175.83] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749647155413899529?= X-GMAIL-MSGID: =?utf-8?q?1749647155413899529?= free_irq() is missing in case of error in at91_wdt_init(), use devm_request_irq to fix that. Fixes: 5161b31dc39a ("watchdog: at91sam9_wdt: better watchdog support") Signed-off-by: ruanjinjie Reviewed-by: Guenter Roeck --- drivers/watchdog/at91sam9_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c index 292b5a1ca831..b9e8572c707d 100644 --- a/drivers/watchdog/at91sam9_wdt.c +++ b/drivers/watchdog/at91sam9_wdt.c @@ -206,7 +206,7 @@ static int at91_wdt_init(struct platform_device *pdev, struct at91wdt *wdt) "min heartbeat and max heartbeat might be too close for the system to handle it correctly\n"); if ((tmp & AT91_WDT_WDFIEN) && wdt->irq) { - err = request_irq(wdt->irq, wdt_interrupt, + err = devm_request_irq(dev, wdt->irq, wdt_interrupt, IRQF_SHARED | IRQF_IRQPOLL | IRQF_NO_SUSPEND, pdev->name, wdt);