From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED5F8CD11DD for ; Fri, 29 Mar 2024 12:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LHqhU3mHphkUVu4D+S5Cc73gmj0Ce9Gaqpc/tgjebWY=; b=Y7hO4xb9eTwKu8 DVi7E2BSgXilEhnNO7YBf6D9PIh20P2Ne8Zg3TBTkI54Z827nM/UtDMosVisR92Pu3+ZiOM66yHbX EK4Q0pYw+P/KDC+IM1u+wIZg37oE9uj7SNQHAKRrMr6JzNfqSSii5arUxtATyrVVj9q8zO8+u/EfJ rmtkxd0uLcSSburalqSjGdeXuVyXki5Y9ipaJzGX/QihgqiUmcjhdwe2Q0OiPdf2y5Nfv+SDr14Fs AtL56NNynlfnaAc/QgyOq+uhlzT5yxbkDNeYEnIeIrdsKTmqhh6Jeo/RLHcpv6ASG1ub0KsTsNggx KG0mFCMQ+RwlnMI0ziVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rqBi3-00000000Ucq-0oxF; Fri, 29 Mar 2024 12:51:51 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rqBag-00000000RCL-2D9i for linux-arm-kernel@lists.infradead.org; Fri, 29 Mar 2024 12:44:17 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D6A29618C5; Fri, 29 Mar 2024 12:44:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FE2DC433B2; Fri, 29 Mar 2024 12:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711716253; bh=yEd0TIh/lRZcOAMIPybsRJxzmRYTgRG5NAGV2GK4dAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=porQ4QwYEAWtWs7THmyABLVeICWdo4nooftQCppgnkRNacFVqBNUf8JViq+yt/B5a VOvbzi+mfXd+nTfgZkzLpMPtp/GVu/usGRZHGj0ifWNBVOPD6qNqFa19KIbOevGXwK sFsojl4FcywGl1bwFkvNmhDhz1rHcf18te+TJ6I85VKhgW9ClIuwLCs1SFh4N86dPh 0x7XmBQuKKW6Xl+7Po6t/bmzkvxrZAX8j08U9KbJDD5dsobnKws5pWiuruYshP8nPz lZr16UFvCBvh7WT6jVD5wY/qJ5LPkEtGd9JydqipMBmgofdzOQUP0jkpkqRBei2z6E 4nsBqs4H10FXQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kunwu Chan , Ulf Hansson , Sasha Levin , nm@ti.com, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 23/75] pmdomain: ti: Add a null pointer check to the omap_prm_domain_init Date: Fri, 29 Mar 2024 08:42:04 -0400 Message-ID: <20240329124330.3089520-23-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240329124330.3089520-1-sashal@kernel.org> References: <20240329124330.3089520-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.23 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240329_054415_183943_3023408C X-CRM114-Status: UNSURE ( 9.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Kunwu Chan [ Upstream commit 5d7f58ee08434a33340f75ac7ac5071eea9673b3 ] devm_kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Signed-off-by: Kunwu Chan Link: https://lore.kernel.org/r/20240118054257.200814-1-chentao@kylinos.cn Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/pmdomain/ti/omap_prm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pmdomain/ti/omap_prm.c b/drivers/pmdomain/ti/omap_prm.c index c2feae3a634ca..b8ceb3c2b81c2 100644 --- a/drivers/pmdomain/ti/omap_prm.c +++ b/drivers/pmdomain/ti/omap_prm.c @@ -695,6 +695,8 @@ static int omap_prm_domain_init(struct device *dev, struct omap_prm *prm) data = prm->data; name = devm_kasprintf(dev, GFP_KERNEL, "prm_%s", data->name); + if (!name) + return -ENOMEM; prmd->dev = dev; prmd->prm = prm; -- 2.43.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel