From patchwork Fri Sep 28 09:30:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 1517941 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C4E2CDF283 for ; Fri, 28 Sep 2012 09:31:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757057Ab2I1JbN (ORCPT ); Fri, 28 Sep 2012 05:31:13 -0400 Received: from smtp-vbr6.xs4all.nl ([194.109.24.26]:2369 "EHLO smtp-vbr6.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755869Ab2I1JbH (ORCPT ); Fri, 28 Sep 2012 05:31:07 -0400 Received: from alastor.dyndns.org (166.80-203-20.nextgentel.com [80.203.20.166] (may be forged)) (authenticated bits=0) by smtp-vbr6.xs4all.nl (8.13.8/8.13.8) with ESMTP id q8S9UPqr096890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 28 Sep 2012 11:30:25 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) Received: from tschai.cisco.com (64-103-25-233.cisco.com [64.103.25.233]) (Authenticated sender: hans) by alastor.dyndns.org (Postfix) with ESMTPSA id 9B43B35C00C8; Fri, 28 Sep 2012 11:30:24 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Sylwester Nawrocki , Pawel Osciak , Marek Szyprowski , Hans Verkuil Subject: [RFCv2 PATCH 3/4] v4l2-ioctl.c: handle PREPARE_BUF like QUERYBUF. Date: Fri, 28 Sep 2012 11:30:11 +0200 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348824612-2857-1-git-send-email-hverkuil@xs4all.nl> References: <1348824612-2857-1-git-send-email-hverkuil@xs4all.nl> In-Reply-To: <2ffce29d048fbe637273d08abd506d128194d7d9.1348824367.git.hans.verkuil@cisco.com> References: <2ffce29d048fbe637273d08abd506d128194d7d9.1348824367.git.hans.verkuil@cisco.com> X-Virus-Scanned: by XS4ALL Virus Scanner Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Hans Verkuil 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. Signed-off-by: Hans Verkuil --- drivers/media/v4l2-core/v4l2-ioctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 09512eb..6ae885d 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2182,6 +2182,7 @@ static int check_array_args(unsigned int cmd, void *parg, size_t *array_size, int ret = 0; switch (cmd) { + case VIDIOC_PREPARE_BUF: case VIDIOC_QUERYBUF: case VIDIOC_QBUF: case VIDIOC_DQBUF: {