[PATCH v2 1/8] v4l: vsp1: Protect fragments against overflow

2017-08-14 Thread Kieran Bingham
The fragment write function relies on the code never asking it to write more than the entries available in the list. Currently with each list body containing 256 entries, this is fine, but we can reduce this number greatly saving memory. In preparation of this - add a level of protection to catch

Re: [PATCH v2 1/8] v4l: vsp1: Protect fragments against overflow

2017-08-16 Thread Laurent Pinchart
Hi Kieran, Thank you for the patch. On Monday 14 Aug 2017 16:13:24 Kieran Bingham wrote: > The fragment write function relies on the code never asking it to > write more than the entries available in the list. > > Currently with each list body containing 256 entries, this is fine, > but we can r

Re: [PATCH v2 1/8] v4l: vsp1: Protect fragments against overflow

2017-08-17 Thread Kieran Bingham
Hi Laurent, Thanks for your review, On 16/08/17 22:53, Laurent Pinchart wrote: > Hi Kieran, > > Thank you for the patch. > How about > > if (WARN_ONCE(dlb->num_entries >= dlb->max_entries, > "DLB size exceeded (max %u)", dlb->max_entries)) > return; > >