summaryrefslogtreecommitdiff
path: root/block/partitions/of.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/partitions/of.c')
-rw-r--r--block/partitions/of.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/block/partitions/of.c b/block/partitions/of.c
index 4e760fdffb3f..53664ea06b65 100644
--- a/block/partitions/of.c
+++ b/block/partitions/of.c
@@ -36,7 +36,6 @@ static void add_of_partition(struct parsed_partitions *state, int slot,
struct device_node *np)
{
struct partition_meta_info *info;
- char tmp[sizeof(info->volname) + 4];
const char *partname;
int len;
@@ -63,8 +62,7 @@ static void add_of_partition(struct parsed_partitions *state, int slot,
partname = of_get_property(np, "name", &len);
strscpy(info->volname, partname, sizeof(info->volname));
- snprintf(tmp, sizeof(tmp), "(%s)", info->volname);
- strlcat(state->pp_buf, tmp, PAGE_SIZE);
+ seq_buf_printf(&state->pp_buf, "(%s)", info->volname);
}
int of_partition(struct parsed_partitions *state)
@@ -76,8 +74,10 @@ int of_partition(struct parsed_partitions *state)
struct device_node *partitions_np = of_node_get(ddev->of_node);
if (!partitions_np ||
- !of_device_is_compatible(partitions_np, "fixed-partitions"))
+ !of_device_is_compatible(partitions_np, "fixed-partitions")) {
+ of_node_put(partitions_np);
return 0;
+ }
slot = 1;
/* Validate parition offset and size */
@@ -104,7 +104,8 @@ int of_partition(struct parsed_partitions *state)
slot++;
}
- strlcat(state->pp_buf, "\n", PAGE_SIZE);
+ seq_buf_puts(&state->pp_buf, "\n");
+ of_node_put(partitions_np);
return 1;
}