Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp3538lqz; Fri, 29 Mar 2024 06:58:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUufY/uR8VXQz+7FDm4gA6cy9iszVIjiRZIj3Pv5cZbT3XAtdNV0blzwomoIhrPTNAXSmFBxMkZtidSq9su8r1LSwg0mQ8X0RBVGmwotQ== X-Google-Smtp-Source: AGHT+IE8W7zHwyjKOSURUzsG7yw3yXjHTy1xeUN05Vypebh8B0cz2zcXRuofJ3HsJXuKn05GTVx7 X-Received: by 2002:a17:902:b70b:b0:1dc:de65:623b with SMTP id d11-20020a170902b70b00b001dcde65623bmr2050535pls.60.1711720706124; Fri, 29 Mar 2024 06:58:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711720706; cv=pass; d=google.com; s=arc-20160816; b=AfE5e/uc1G/MwyKhB0J3EHoewuCiGwBsoXYHGveVVpFsdepq4kg/9rmtSYblTNX+Rb BDEEF2H6oXFOrx+zwrhRztonhYSoxb1xnMKnml57GnxnLkEmztYxbwXu+023q6oRZU4M aKODO4gk6rMqj9T0cj2/V0appmTHANs8mhDhUBd2NCjtnWvOYEWFcIE8K5iI8y8M8RWo D0EFNLFfc3/bRS8BET9oOtv1TXUTvzgVwzXKk2O/L8AeebIp2Vrseqc1IYCE50gLseax J9yRZErzqy3X5WMj6mjuIB+JsXq3kOJHLbFfa8sX7x+q7wsu9VGI5Q1FCYy+6wZ7Tg+/ vpHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kh+9q4weeq4nKwrj/xAfBtrr10CdfqkqPu/tAutL5tY=; fh=jBcEeTjSYGQlOjFfJeQXNQCAatG5ih4XujX8+TjPsbY=; b=IuErBgIHvMCQ8zCYn7sPFa1jfAlbD/x3ItMNGA0cSuFKwACXm3Jvny8z1GyU6sY2rk A8kbYK+H2SBQugd0YrzqCUW2WNXPr+VoMZOF0j5T/jDpG/MWoqDDuoOZlZ6fhgjDBIdS +jfHWiHdFYnCwfaNZmAZe+y4ARX6fdmVHDzBZrbHIlMtSicprZk6k4HTF+GpiAcP4RjA jbzRNPXi9TjjjwW57EMpHx1JI8tTFqeDm22mmo87ee22smJuJ8LubGKXbgu0a+33sbQW XU5FF8HoCoSOTMYau2eMkTkHoLwS2u2b2K+iVbgxPEX337b2td98gZud9vFaSwIcuVFv szxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jLylTHJ2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m24-20020a170902bb9800b001e0f504a755si3500676pls.208.2024.03.29.06.58.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 06:58:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jLylTHJ2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 998A7B27AF8 for ; Fri, 29 Mar 2024 13:39:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A3DC17A935; Fri, 29 Mar 2024 12:41:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jLylTHJ2" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5890617A91E; Fri, 29 Mar 2024 12:41:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716063; cv=none; b=I8+2obs9tYZYSy6i56U9wdgAu3LLM7Clt9FSg7o5IN3s9/cU1rHVl5udPUipMNcBVTAlNw36iMDDLWy9S5AgvheMIMbrZH09/c22xMWbIXMpdUo0T/cOb88mEh1xQTEat5MiXER2TU89NgY89TUF3RD3hTo1NleW7TSVWiNHuno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716063; c=relaxed/simple; bh=yEd0TIh/lRZcOAMIPybsRJxzmRYTgRG5NAGV2GK4dAk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rSwwGDdv6onkBigZyrSkbrNyNmBkPtmgF2V2YGxeu8KdyPw+Vx1N+FXC28vn5BRebdg6z/GZaUXj43vd+VGEtFChJhgI5UN7cihPc9xOx0h2woX1QaMyPuBccBomgdYk4oAJwnQ7toCYnsmHROneAopipPbZdPSgVNHal9WIB/E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jLylTHJ2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05DC8C433F1; Fri, 29 Mar 2024 12:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711716062; bh=yEd0TIh/lRZcOAMIPybsRJxzmRYTgRG5NAGV2GK4dAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jLylTHJ2s/+I9PFxdsiKBpPOwiJbWAhC5u8lhCgPSOI6KOKaZMBHXD/hfSB+HJrNs QfE4s/1xJNiu4bcOdsq9t1uN6CH19/JOilG1JXKg0zhba3U6lSyptEqZw3llLBKJY7 FU474TEnkU5KMHT7fPP2AGHt6hVzxJ43UV6Q44TJz4Sdq5kjwyI+9xhfyrDQ3Kt3NN 9BK0BmCxF1SegTsMFO32A+XcYDsYuQZnVxh9cnnIQqxNf/85dDTzCTgSWO4ONRP+o3 yIjzodo2oSoSy2+XRy7b9B0CeGafRw+U4964FvTkLSbOBYiXfK5Bjue1eaG2fjD4gN g76XaKttE7K9Q== 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.8 34/98] pmdomain: ti: Add a null pointer check to the omap_prm_domain_init Date: Fri, 29 Mar 2024 08:37:05 -0400 Message-ID: <20240329123919.3087149-34-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240329123919.3087149-1-sashal@kernel.org> References: <20240329123919.3087149-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.2 Content-Transfer-Encoding: 8bit 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