From patchwork Sun Jun 10 14:24:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 10456685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5ADD4601F7 for ; Sun, 10 Jun 2018 15:09:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46DEF26E49 for ; Sun, 10 Jun 2018 15:09:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3831C26E55; Sun, 10 Jun 2018 15:09:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C58B126E49 for ; Sun, 10 Jun 2018 15:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=7uh2ohgnh9J/ObiAwc+n/GFBw4DGRvwiiivbuOn+Z2k=; b=Egv L/eyUjdHJq+aft5wvWMnsUWLaUSQIhcilAUjNLctGd4YRVJCziQOdkHZ6n7jrAVT9m18dBl2L8Q5M +dT30+mp8Q7I9uCo3qQTTwzbe3CfzrxYFeCgChBfAi+JesiJN6EYBBqbuhsOs4pBpJwZGCJYy79sh Vi8DUv+mrVp5ZudOyE7TrI8l1T0y7ZooPFswrH8m27UaG3D9BlyO8JyEfI6pm3kHsMwSnKJg3c9iR wRRMV7oU8D6tMprNpPyY3NXnCmtyJ+ViksqBjWZZ+My3V/NiuoAV/ZKZpJD88uV63dtiOYK/CFtYu /fSbv5KJ3wl7mNlQDcFJ1LYLqYigG9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fS1y1-0003GI-OC; Sun, 10 Jun 2018 15:09:17 +0000 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fS1xx-00036S-21 for linux-arm-kernel@lists.infradead.org; Sun, 10 Jun 2018 15:09:15 +0000 X-IronPort-AV: E=Sophos;i="5.49,498,1520895600"; d="scan'208";a="331181271" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA256; 10 Jun 2018 16:56:19 +0200 From: Julia Lawall To: Daniel Lezcano Subject: [PATCH] clocksource/drivers/stm32: fix error return code Date: Sun, 10 Jun 2018 16:24:15 +0200 Message-Id: <1528640655-18948-3-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180610_080913_374192_9F3B1FD3 X-CRM114-Status: GOOD ( 10.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Torgue , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Maxime Coquelin , Thomas Gleixner , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Return an error code on failure. Problem found using Coccinelle. Signed-off-by: Julia Lawall --- drivers/clocksource/timer-stm32.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-stm32.c b/drivers/clocksource/timer-stm32.c index e5cdc3a..2717f88 100644 --- a/drivers/clocksource/timer-stm32.c +++ b/drivers/clocksource/timer-stm32.c @@ -304,8 +304,10 @@ static int __init stm32_timer_init(struct device_node *node) to->private_data = kzalloc(sizeof(struct stm32_timer_private), GFP_KERNEL); - if (!to->private_data) + if (!to->private_data) { + ret = -ENOMEM; goto deinit; + } rstc = of_reset_control_get(node, NULL); if (!IS_ERR(rstc)) {