selftests: gpio-mockup-chardev: Check asprintf() for error
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 14 Jan 2019 13:51:33 +0000 (14:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Mar 2019 16:57:59 +0000 (17:57 +0100)
commit51f08abcd74233d4a5dcc1d20e74e786a67bd52f
tree46b4beb7ca6cf337992cb949fc29c5806a5d7907
parent289ee4095263372eb9ccbb4f2e2028ed37e5f9f7
selftests: gpio-mockup-chardev: Check asprintf() for error

[ Upstream commit 508cacd7da6659ae7b7bdd0a335f675422277758 ]

With gcc 7.3.0:

    gpio-mockup-chardev.c: In function ‘get_debugfs’:
    gpio-mockup-chardev.c:62:3: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
       asprintf(path, "%s/gpio", mnt_fs_get_target(fs));
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Handle asprintf() failures to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Shuah Khan <shuah@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/gpio/gpio-mockup-chardev.c