From: Hans Verkuil Date: Mon, 24 Feb 2014 16:41:20 +0000 (-0300) Subject: [media] vb2: don't init the list if there are still buffers X-Git-Tag: v3.15-rc1~85^2~163 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7afcaccfab2fb012841852eaead79861dc9cb5f;p=pandora-kernel.git [media] vb2: don't init the list if there are still buffers __vb2_queue_free() would init the queued_list at all times, even if q->num_buffers > 0. This should only happen if num_buffers == 0. This situation can happen if a CREATE_BUFFERS call couldn't allocate enough buffers and had to free those it did manage to allocate before returning an error. While we're at it: __vb2_queue_alloc() returns the number of buffers allocated, not an error code. So stick the result in allocated_buffers instead of ret as that's very confusing. Signed-off-by: Hans Verkuil Acked-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed