[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220506022845.26750-1-puyou.lu@gmail.com>
Date: Fri, 6 May 2022 10:28:43 +0800
From: Puyou Lu <puyou.lu@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: puyou.lu@...il.com, Andy Shevchenko <andy@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Petr Mladek <pmladek@...e.com>,
Linus Walleij <linus.walleij@...aro.org>,
Guenter Roeck <linux@...ck-us.net>,
Chris Down <chris@...isdown.name>, linux-kernel@...r.kernel.org
Subject: [PATCH] lib/string_helpers: add allocated strarray to device resource.
This is a must to automatically release strarray when the device
disappears.
Signed-off-by: Puyou Lu <puyou.lu@...il.com>
---
lib/string_helpers.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/string_helpers.c b/lib/string_helpers.c
index 4f877e9551d5..b4497c068172 100644
--- a/lib/string_helpers.c
+++ b/lib/string_helpers.c
@@ -757,6 +757,7 @@ char **devm_kasprintf_strarray(struct device *dev, const char *prefix, size_t n)
return ERR_PTR(-ENOMEM);
}
+ devres_add(dev, ptr);
return ptr->array;
}
EXPORT_SYMBOL_GPL(devm_kasprintf_strarray);
--
2.17.1
Powered by blists - more mailing lists