Re: [PATCH 4/4] drm: Simplify GETRESOURCES ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Dec 10, 2016 at 11:04 PM, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> 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)) {
>
> In this style increment of count has to happen after the copy.
>
> i.e.
>         if (count < card_res->count_fbs &&
>             put_user(fb->base.id, fb_id + count) {
>             mutex_unlock()
>             return -EFAULT;
>         }
>         count++;

Note I also have > instead of  <, so I think it should be equivalent.
Oops except for the connector lop, silly me that lost one.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux