Add a comment clarifying the variable-size array created on the stack will always be either CRYPTO_MAX_ALG_NAME (64) or 32 bytes long.
Signed-off-by: Dan Streetman <[email protected]> --- mm/zswap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/zswap.c b/mm/zswap.c index 7bbecd9..b198081 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -691,6 +691,11 @@ static int __zswap_param_set(const char *val, const struct kernel_param *kp, char str[kp->str->maxlen], *s; int ret; + /* + * kp is either zswap_zpool_kparam or zswap_compressor_kparam, defined + * at the top of this file, so maxlen is CRYPTO_MAX_ALG_NAME (64) or + * 32 (arbitrary). + */ strlcpy(str, val, kp->str->maxlen); s = strim(str); -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

