[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 12 Dec 2016 20:42:13 +0000
From: Chris Wilson <chris@...is-wilson.co.uk>
To: Gustavo Padovan <gustavo@...ovan.org>
Cc: dri-devel@...ts.freedesktop.org,
Gustavo Padovan <gustavo.padovan@...labora.co.uk>,
"open list:DRM DRIVER FOR MSM ADRENO GPU"
<linux-arm-msm@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
"open list:DRM DRIVER FOR MSM ADRENO GPU"
<freedreno@...ts.freedesktop.org>
Subject: Re: [PATCH] drm/msm: return fence_fd = -1 if gem_submit fails
On Mon, Dec 12, 2016 at 05:41:08PM -0200, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@...labora.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
Powered by blists - more mailing lists