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)
committerShuah Khan <shuah@kernel.org>
Wed, 16 Jan 2019 22:02:57 +0000 (15:02 -0700)
commit508cacd7da6659ae7b7bdd0a335f675422277758
tree8171cf2aade696312fea07ef6ab5c61a323df4cf
parent5bbc73a841d7f0bbe025a342146dde462a796a5a
selftests: gpio-mockup-chardev: Check asprintf() for error

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>
tools/testing/selftests/gpio/gpio-mockup-chardev.c