From patchwork Mon Oct 17 16:46:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13009041 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 389CCC4332F for ; Mon, 17 Oct 2022 16:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229725AbiJQQrS (ORCPT ); Mon, 17 Oct 2022 12:47:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229594AbiJQQrR (ORCPT ); Mon, 17 Oct 2022 12:47:17 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB6221FF9F for ; Mon, 17 Oct 2022 09:47:16 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id a13so16972019edj.0 for ; Mon, 17 Oct 2022 09:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gVq1slC8WyteXvk7RgIypCJejBcKboJNQiDOlth57NM=; b=WLhZOoL0+ZlT3dtpqnUUanAxr3S3mdBeaPUVrfBjeO6OTToxShZto4EIoSHhXL+A+o 3X4OIFRZc6kNM/uFgD9++gNH2IR0kY0OzVjf5t2eSpPUgDgPswtp4G913D9XCgQFaT9j m03i19GeBSu59zjOA0uFAw0k/etEpSuDmanmc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gVq1slC8WyteXvk7RgIypCJejBcKboJNQiDOlth57NM=; b=Jjim5ojzFzgymjX9VuwASBy8FGdWkDnQAJRFpH2D8g9DAzeFeRizd4beQrFyCKxxhc 4iOJHkozWrpnCltifNoGyej381qXvw64wVfGDPj2RyEhjLbLdrD8qQ1t9XDoO0ka0QvA DTqaytu48yBoZkz8LqR9MaX/ru0cHC+yukf3p++Tblrcyc3kilKcJLyq6YObwTUeZooT aOdv+7+/XnnVgug8YEu4Zwd//RCTk5fFEsYLNHATFxu9X9VYhtc+AvNy7eLqR/UQxUtm yEakj7/nRkBk8i0T4gI5qYto2ZSxZUjCNYZnEo9n95Urr3Ig2xrMHVAEYe3XI4TRqQPG B8rw== X-Gm-Message-State: ACrzQf2AJ3xeh31nxCWxcCf+lDUcAmFwmKjR6gJitrQ9b8/CmBG0ntsF bIGy4bC6KxEbew8SOkVFefV7Xg== X-Google-Smtp-Source: AMsMyM7JzS8qgO6HKr9k/3n5USEcYA/w3vjO4D99E/pC1lnADlVjuncf3w8SKHgf2bailRsMya+j4A== X-Received: by 2002:a05:6402:2706:b0:45d:aaae:e74a with SMTP id y6-20020a056402270600b0045daaaee74amr3392104edd.72.1666025235279; Mon, 17 Oct 2022 09:47:15 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-244-101-110.retail.telecomitalia.it. [95.244.101.110]) by smtp.gmail.com with ESMTPSA id va30-20020a17090711de00b0078d61c5db0asm6316887ejb.49.2022.10.17.09.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 09:47:14 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Greg Kroah-Hartman , Michael Turquette , Stephen Boyd , Tero Kristo , Thomas Gleixner , Tony Lindgren , linux-clk@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH] clk: ti: mux: don't free `parent_names' on kzalloc() failure Date: Mon, 17 Oct 2022 18:46:46 +0200 Message-Id: <20221017164646.4193618-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Although no operation is performed by kfree() on a NULL pointer, it's however suboptimal and semantically wrong doing it. Signed-off-by: Dario Binacchi --- drivers/clk/ti/mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c index 46b45b3e8319..1f924db2ad98 100644 --- a/drivers/clk/ti/mux.c +++ b/drivers/clk/ti/mux.c @@ -182,7 +182,7 @@ static void of_mux_clk_setup(struct device_node *node) } parent_names = kzalloc((sizeof(char *) * num_parents), GFP_KERNEL); if (!parent_names) - goto cleanup; + return; of_clk_parent_fill(node, parent_names, num_parents);