of: fix CONFIG_CMDLINE_EXTEND
strlcat takes the size of the buffer, not the number of characters to concatenate. If the size of the device tree command line p is larger than the CONFIG_CMDLINE string data, then strcat(data, p, l) will hit a BUG_ON because strlen(data) > l. Replace the second strlcat with a strncpy plus a manual null termination. Also rearrange the code to reduce indent depth to make it more readable, and replace data with a char *cmdline to avoid extra casts. Signed-off-by:Colin Cross <ccross@android.com> Git-commit: a2acc58bc7460a03627f20842a7169d7a1328299 Git-repo: https://android.googlesource.com/kernel/common.git Signed-off-by:
Ian Maund <imaund@codeaurora.org>
Loading
Please register or sign in to comment