All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] pstore/ram: Replace of_node_put with __free() for automatic cleanup
@ 2024-06-05 21:49 Abhinav Jain
  2024-06-06 16:03 ` Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: Abhinav Jain @ 2024-06-05 21:49 UTC (permalink / raw)
  To: keescook, tony.luck, gpiccoli, linux-hardening, linux-kernel
  Cc: skhan, javier.carrasco.cruz, jain.abhinav177, julia.lawall

Add __free(device_node) to the parent_node struct declaration
Add changes to incorporate the review comments from v1

Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com>

PATCH v1 link:
https://lore.kernel.org/all/20240415161409.8375-1-jain.abhinav177@gmail.com/

Changes since v1:
 - Moved the variable definition back to the top of the function body
---
 fs/pstore/ram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 14f2f4864e48..f8258e4567c3 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -644,6 +644,7 @@ static int ramoops_parse_dt(struct platform_device *pdev,
 			    struct ramoops_platform_data *pdata)
 {
 	struct device_node *of_node = pdev->dev.of_node;
+	struct device_node *parent_node __free(device_node) = of_node_parent(of_node);
 	struct resource *res;
 	u32 value;
 	int ret;
@@ -703,7 +704,6 @@ static int ramoops_parse_dt(struct platform_device *pdev,
 	 * we're not a child of "reserved-memory" and mimicking the
 	 * expected behavior.
 	 */
-	struct device_node *parent_node __free(device_node) = of_node_parent(of_node);
 	if (!of_node_name_eq(parent_node, "reserved-memory") &&
 	    !pdata->console_size && !pdata->ftrace_size &&
 	    !pdata->pmsg_size && !pdata->ecc_info.ecc_size) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-09 12:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-05 21:49 [PATCH v2] pstore/ram: Replace of_node_put with __free() for automatic cleanup Abhinav Jain
2024-06-06 16:03 ` Kees Cook
2024-06-09 12:43   ` Abhinav Jain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.