From patchwork Wed Sep 19 14:37:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 1477891 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 21E29DF280 for ; Wed, 19 Sep 2012 14:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751589Ab2ISOih (ORCPT ); Wed, 19 Sep 2012 10:38:37 -0400 Received: from smtp-vbr14.xs4all.nl ([194.109.24.34]:1109 "EHLO smtp-vbr14.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157Ab2ISOie (ORCPT ); Wed, 19 Sep 2012 10:38:34 -0400 Received: from alastor.dyndns.org (166.80-203-20.nextgentel.com [80.203.20.166] (may be forged)) (authenticated bits=0) by smtp-vbr14.xs4all.nl (8.13.8/8.13.8) with ESMTP id q8JEboMf091195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 19 Sep 2012 16:37:50 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) Received: from tschai.lan (tschai.lan [192.168.1.10]) (Authenticated sender: hans) by alastor.dyndns.org (Postfix) with ESMTPSA id 0E51235C0148; Wed, 19 Sep 2012 16:37:43 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Pawel Osciak , Marek Szyprowski , Hans Verkuil Subject: [RFCv1 PATCH 5/6] v4l2-ioctl,c: handle PREPARE_BUF like QUERYBUF. Date: Wed, 19 Sep 2012 16:37:39 +0200 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348065460-1624-1-git-send-email-hverkuil@xs4all.nl> References: <1348065460-1624-1-git-send-email-hverkuil@xs4all.nl> In-Reply-To: <9e4acd70e02bb67e6e7af0c236c69af27108e4fa.1348064901.git.hans.verkuil@cisco.com> References: <9e4acd70e02bb67e6e7af0c236c69af27108e4fa.1348064901.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 932d9bf..bbbda4e 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2173,6 +2173,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: {