]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: watchdog: Validate optional file argument
authorGeorge G. Davis <george_davis@mentor.com>
Tue, 17 Sep 2019 18:40:22 +0000 (20:40 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 2 Oct 2019 19:44:04 +0000 (13:44 -0600)
commit4cc5268fa33ec6dac9c858af91db3e0b2c86fbab
treedf13c48fa289201ac285fcec3ec8b7321f154c2e
parent00e694e6f2c34cb2c7ae733572286e039859f76d
selftests: watchdog: Validate optional file argument

The newly added optional file argument does not validate if the
file is indeed a watchdog, e.g.:

./watchdog-test  -f /dev/zero
Watchdog Ticking Away!

Fix it by confirming that the WDIOC_GETSUPPORT ioctl succeeds.

Fixes: 751b388d3672f5 ("selftests: watchdog: Add optional file argument")
Reported-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: George G. Davis <george_davis@mentor.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/watchdog/watchdog-test.c