Summary: | Fix Valgrind error in drmPrimeHandleToFD | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | DRI | Reporter: | Guillaume Desmottes <guillaume.desmottes> | ||||||||
Component: | libdrm | Assignee: | Default DRI bug account <dri-devel> | ||||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | medium | ||||||||||
Version: | XOrg git | ||||||||||
Hardware: | Other | ||||||||||
OS: | All | ||||||||||
Whiteboard: | |||||||||||
i915 platform: | i915 features: | ||||||||||
Attachments: |
|
Description
Guillaume Desmottes
2015-04-27 13:48:14 UTC
Created attachment 115375 [details] [review] drmPrimeHandleToFD: initialize args.fd to 0 Hi Guillaume With args.fd used for output this seems like a false positive. Alternative solution would be to make Valgrind aware of this. A similar issue exists for args.handle in drmPrimeFDToHandle. I fear that not many people keep track of bugzilla, so please forward your patch to the dri-devel mailing list [1]. Thanks Emil [1] dri-devel@lists.freedesktop.org Created attachment 115403 [details] [review] drmPrime*: initialize output args to 0 Here is a patch for both functions. I agree it's probably a false positive but the fix is simple enough to be worth adding those extra lines and saving people the trouble of debugging those. I'll send the patch to the list as well. If you initialize an fd, at least initialize it to the invalid file descriptor -1. Zero is a valid file descriptor and very often already an open one. Created attachment 115430 [details] [review] drmPrime*: initialize output args to 0 Added an extra memclear(args) for each function and pushed to master. Thanks Emil |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.