From: Krzysztof Kozlowski Date: Thu, 16 Apr 2026 13:09:13 +0000 (+0200) Subject: interconnect: Do not create empty devres on missing interconnects X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7562778563ada536bf52123ff06aa749cba2d1b9;p=thirdparty%2Flinux.git interconnect: Do not create empty devres on missing interconnects of_icc_get() returns NULL on valid case - no interconnects - but no need to create devres for that, because it just wastes memory without any use/benefits. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Kuan-Wei Chiu Link: https://patch.msgid.link/20260416130912.375013-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Georgi Djakov --- diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 8569b78a18517..ce572c62f58f9 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -432,7 +432,7 @@ struct icc_path *devm_of_icc_get(struct device *dev, const char *name) return ERR_PTR(-ENOMEM); path = of_icc_get(dev, name); - if (!IS_ERR(path)) { + if (!IS_ERR_OR_NULL(path)) { *ptr = path; devres_add(dev, ptr); } else {