Re: [Intel-gfx] [PATCH 4/4] drm: Simplify GETRESOURCES ioctl

2016-12-11 Thread Daniel Vetter
On Sat, Dec 10, 2016 at 11:04 PM, Chris Wilson wrote: >> + list_for_each_entry(fb, &file_priv->fbs, filp_head) { >> + count++; >> + if (count > card_res->count_fbs) >> + continue; >> + >> + if (put_user(fb->base.id, fb_id + count)) { > >

Re: [Intel-gfx] [PATCH 4/4] drm: Simplify GETRESOURCES ioctl

2016-12-10 Thread Chris Wilson
On Sat, Dec 10, 2016 at 10:52:55PM +0100, Daniel Vetter wrote: > Looping twice when we can do it once is silly. Also use a consistent > style. Note that there's a good race with the connector list walking, > since that is no longer protected by mode_config.mutex. But that's for > a later patch to f

[Intel-gfx] [PATCH 4/4] drm: Simplify GETRESOURCES ioctl

2016-12-10 Thread Daniel Vetter
Looping twice when we can do it once is silly. Also use a consistent style. Note that there's a good race with the connector list walking, since that is no longer protected by mode_config.mutex. But that's for a later patch to fix. v2: Actually try to not blow up, somehow I lost the hunk that chec