pinctrl: samsung: don't truncate the last char
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 22 Jun 2015 15:12:24 +0000 (18:12 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 16 Jul 2015 08:20:03 +0000 (10:20 +0200)
commit8749f8ed5cc07f4f130f2e5b2c41da78388146ec
tree4e3b5ab995587f70f03d34bb96843833996ee36a
parent95b612cc6c7f95f4e08f1b3dbc6588fda49b1b12
pinctrl: samsung: don't truncate the last char

We were allocating enough space because sizeof("-grp") and
sizeof("-mux") are both equal to 5 but in the snprintf() we only allowed
for 4 characters so the last 'p' and 'x' characters were truncated.

The allocate and sprintf can be done in one step with the kasprintf().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/samsung/pinctrl-exynos5440.c