summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorShuah Khan <shuahkh@osg.samsung.com>2016-02-25 10:17:42 -0700
committerShuah Khan <shuahkh@osg.samsung.com>2016-02-25 17:22:36 -0700
commit36d3f7d8204dabc225febdeca9db8a3114cc9b6d (patch)
treeae718929c8ddf3c855d9ca1581245034f2696722 /tools
parent3b48bfc0ab997d43fa89190c769a881db853c569 (diff)
downloadlinux-36d3f7d8204dabc225febdeca9db8a3114cc9b6d.tar.gz
linux-36d3f7d8204dabc225febdeca9db8a3114cc9b6d.tar.bz2
linux-36d3f7d8204dabc225febdeca9db8a3114cc9b6d.zip
selftests: media_dcevice_test fix to handle ioctl failure case
Fix to print information returned by ioctl only when it returns success. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/media_tests/media_device_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/media_tests/media_device_test.c b/tools/testing/selftests/media_tests/media_device_test.c
index a47880b9e00a..7a4d613f4742 100644
--- a/tools/testing/selftests/media_tests/media_device_test.c
+++ b/tools/testing/selftests/media_tests/media_device_test.c
@@ -86,8 +86,9 @@ int main(int argc, char **argv)
ret = ioctl(fd, MEDIA_IOC_DEVICE_INFO, &mdi);
if (ret < 0)
printf("Media Device Info errno %s\n", strerror(errno));
- printf("Media device model %s driver %s\n",
- mdi.model, mdi.driver);
+ else
+ printf("Media device model %s driver %s\n",
+ mdi.model, mdi.driver);
sleep(10);
count++;
}