[media] media: vb2: correct queue initialization order
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 14 Apr 2011 10:17:44 +0000 (07:17 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 19 Apr 2011 19:07:34 +0000 (16:07 -0300)
commit13b140953ab4fd86e2065adfef892fe833986ffa
tree1474b2b818b6d6fe244075c712f6ce218b6490b8
parentea42c8ecb2ff998b8f71e0a5f9d2748a65cb8f04
[media] media: vb2: correct queue initialization order

q->memory entry is initialized to late, so if allocation of memory buffers
fails, the buffers might not be freed correctly (q->memory is tested in
__vb2_free_mem, which can be called before setting q->memory).

Reported-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/videobuf2-core.c