[media] v4l2-ioctl.c: handle PREPARE_BUF like QUERYBUF

The core code for PREPARE_BUF didn't take the multiplanar case into
account, which might cause page faults. Handle PREPARE_BUF just like
QUERYBUF and QBUF/DQBUF.

Change-Id: Ida7f712edec32568a8c2651d54b160121009a9c4
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
CRs-Fixed: 637365
msm: vidc: Validate userspace buffer count

Makesure the number of buffers count is less than
the maximum limit to avoid structure overflow errors.

Change-Id: Icf3850de36325637ae43ac95f1c8f0f63e201d31
CRs-fixed: 563694
Signed-off-by: Pachika, Vikas Reddy <vpachi@codeaurora.org>
msm: vidc: Validate userspace buffer count before using it

Validate the number of buffers count variable before
using it to avoid structure overflow error.

Change-Id: I61582c93e0f26ec6842e437134fb8a42bdbc36ff
CRs-fixed: 563654
Signed-off-by: Pachika, Vikas Reddy <vpachi@codeaurora.org>
Merge "[media] v4l2-ioctl.c: handle PREPARE_BUF like QUERYBUF"
Merge "msm: vidc: Validate userspace buffer count"
Merge "msm: vidc: Validate userspace buffer count before using it"