Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfe4a47b authored by Pradeep P V K's avatar Pradeep P V K Committed by Gerrit - the friendly Code Review server
Browse files

ubi: Use UBI_MAX_VOLUME_NAME for printing ubi volume names



Use UBI_MAX_VOLUME_NAME length for printing ubi volume names
to avoid truncation of ubi volume name fields.

Change-Id: I0ab4577dcc1e4bb93d2bcef1b8e52da98f13ff15
Signed-off-by: default avatarPradeep P V K <quic_pragalla@quicinc.com>
parent 90bd82d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ static ssize_t vol_attribute_show(struct device *dev,
		}
		ret = scnprintf(buf, size, "%s\n", tp);
	} else if (attr == &attr_vol_name)
		ret = scnprintf(buf, vol->name_len + 1, "%s\n",
		ret = scnprintf(buf, UBI_MAX_VOLUME_NAME + 1, "%s\n",
				vol->name);
	else if (attr == &attr_vol_corrupted)
		ret = scnprintf(buf, sizeof(int), "%d\n",