public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/ioctl_wrappers: Assert that prime_handle_to_fd returns a valid fd
@ 2019-03-12 11:21 Petri Latvala
  2019-03-12 11:34 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Petri Latvala @ 2019-03-12 11:21 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

If the ioctl is successful, the returned fd should be valid. Check
that it is, thus also helping static analysis in almost 70 call sites.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/ioctl_wrappers.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 39920f87..31969e77 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -1332,6 +1332,7 @@ int prime_handle_to_fd(int fd, uint32_t handle)
 	args.fd = -1;
 
 	do_ioctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args);
+	igt_assert_fd(args.fd);
 
 	return args.fd;
 }
-- 
2.19.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-03-13 13:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-12 11:21 [igt-dev] [PATCH i-g-t] lib/ioctl_wrappers: Assert that prime_handle_to_fd returns a valid fd Petri Latvala
2019-03-12 11:34 ` Chris Wilson
2019-03-12 13:00   ` Petri Latvala
2019-03-12 13:14     ` Chris Wilson
2019-03-13  9:20       ` Petri Latvala
2019-03-12 12:08 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2019-03-12 15:25 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2019-03-13  8:59   ` Petri Latvala
2019-03-13 13:18     ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox