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: 3607 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1551990wrs; Mon, 17 Oct 2022 10:03:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6pEigsYGwZrEHpIH0eohRieXYULW+bs7SC1qLLO67uXCgu3S8uwCd2srb1meZ9lcGApzo0 X-Received: by 2002:a17:902:f791:b0:17c:c1dd:a3b5 with SMTP id q17-20020a170902f79100b0017cc1dda3b5mr12708488pln.141.1666026235073; Mon, 17 Oct 2022 10:03:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666026235; cv=none; d=google.com; s=arc-20160816; b=vf78oY8KyYWeCglHBK5uJDfQERgPN2dNwvSiFmYWhnLeCbGfJOZ9wbE1hCi/G0XcRE E4wlkRTc/ZCJ/BuVesHf6LqQA7i8Z60almPon0fCp5oZiF2EIxMyWgPJ21Rg6GUPb2xh zmMPcEBq5fGadgGW1fycYoQPUYAut0fiG0w5mUkvzbK1CfcJwMDqNjlLengvbe5ZhLVP FDKOdlBVRsbviOGMDGGVcSwDSw/EFGLHAb39ilBRgq35rYEuyz8Ziuf2qSCHN4et9z5B PAu3BGiXzmJTJkijQg9r3sn5ZWo7E5j0Gt214xdDh7B8QzwExm2ZQIrRnI9L/p9ZFz9J /bnw== 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:dkim-signature; bh=gVq1slC8WyteXvk7RgIypCJejBcKboJNQiDOlth57NM=; b=H7oxjujVOYLanQgHucHKI2M6+JiL6IRJ07eJuU4Hrpx2pH34pvEO7b49OivhWCVeXP a7S9L64PVCkfEe5erS/MnhRENUcoqayML5/UK3TgoFpXO5R2vrk5WRSbH/9xind4bQck Ue+Vaog2nAaqO9dZOXxfiy9zBm65lr6+MCwjzqbDcISPirsmD16QNlPKRpn9TQCncr89 T/ab2A/8eadBgpK4q1Qdswb0Raut1h3l1G60gmZCtavXRlVOuCLhkuEfVAnoHdWZOw1w AH/k01BlqfrDQn3hy65QTDOaVB+owEltmggE2rq0qU/+GnfgRfQHTlzPjOfDHCad7lCc QfWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WLhZOoL0; 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=amarulasolutions.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a170902ebc200b0017deb323079si11924955plg.142.2022.10.17.10.03.37; Mon, 17 Oct 2022 10:03:55 -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=@amarulasolutions.com header.s=google header.b=WLhZOoL0; 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=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbiJQQrT (ORCPT + 99 others); Mon, 17 Oct 2022 12:47:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbiJQQrR (ORCPT ); Mon, 17 Oct 2022 12:47:17 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E40994151C for ; Mon, 17 Oct 2022 09:47:16 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id s2so16952502edd.2 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=4DwXkmCU3vohkAnlJi+8R+9WrRwGQkpjNmHelXtip4hrMkvoKsUY3zNfjl0YvuGltX h6Pc99pHYEX+CJ3JXrsS+LMPGiIKNumZ7hyt0lM9pDj+80h3bNQEMgMN+S7OwqJ/GEQ9 ygYIGB7lDw5PwxU+nv062e95OAHIXeoHyCx2jaoaavsbb+nkkDDtpCNkGvX/8EeDg/ve 1XEr/Dlpl5HKvOPFEg2i73yl+GOS7RBWwvP2J/qVmSWB4z6+Qbd1CgpJjGzL8CH+bHQ4 zk5+OHXBNQ5bdx0FNbzW02hqC03JZRLjONSnvn/PiI8b0iI3nDm2NOPZbl/sIP4bHIcs Q8Qw== X-Gm-Message-State: ACrzQf1qPuqp9AS5lUkQh6yQHTHbXX0yLsyGJhkvovmfsPsqBf5/Mg2V +A5uAIHXxHzLXVvXfjTZG02yMsyiTkbqAw== 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1746955125509125385?= X-GMAIL-MSGID: =?utf-8?q?1746955125509125385?= 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);