Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1540638
| From | Chris Wilson <chris@chris-wilson.co.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] drm/msm: return fence_fd = -1 if gem_submit fails |
| Date | 2016-12-12 21:50 +0100 |
| Message-ID | <sNFHQ-v6-33@gated-at.bofh.it> (permalink) |
| References | <sNELL-8nW-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Dec 12, 2016 at 05:41:08PM -0200, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>
> Previously we were returning garbage here, fix it by setting it to -1
> before the first possible point of failure.
The convention is that on error paths you do not modify user inputs. In
particular, consider EINTR where the usual pattern (e.g. drmIoctl) is
do {
err = ioctl(fd, SUBMIT, arg);
} while (err == -EINTR);
If you modify the in fence before you consume it, you can't recreate it
after handling the signal.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] drm/msm: return fence_fd = -1 if gem_submit fails Gustavo Padovan <gustavo@padovan.org> - 2016-12-12 20:50 +0100
Re: [PATCH] drm/msm: return fence_fd = -1 if gem_submit fails Chris Wilson <chris@chris-wilson.co.uk> - 2016-12-12 21:50 +0100
Re: [PATCH] drm/msm: return fence_fd = -1 if gem_submit fails Gustavo Padovan <gustavo.padovan@collabora.com> - 2016-12-12 22:30 +0100
csiph-web