From patchwork Fri Oct 15 08:45:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 255521 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9F8kaM5029939 for ; Fri, 15 Oct 2010 08:46:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753832Ab0JOIqL (ORCPT ); Fri, 15 Oct 2010 04:46:11 -0400 Received: from smtp-vbr5.xs4all.nl ([194.109.24.25]:4616 "EHLO smtp-vbr5.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753395Ab0JOIqJ (ORCPT ); Fri, 15 Oct 2010 04:46:09 -0400 Received: from tschai.localnet (186.84-48-119.nextgentel.com [84.48.119.186]) (authenticated bits=0) by smtp-vbr5.xs4all.nl (8.13.8/8.13.8) with ESMTP id o9F8jk41009207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Oct 2010 10:45:47 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) From: Hans Verkuil To: Valdis.Kletnieks@vt.edu Subject: Re: mmotm 2010-10-13 - GSPCA SPCA561 webcam driver broken Date: Fri, 15 Oct 2010 10:45:45 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.35-tschai; KDE/4.4.5; x86_64; ; ) Cc: Andrew Morton , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org References: <201010140044.o9E0iuR3029069@imap1.linux-foundation.org> <5158.1287086789@localhost> In-Reply-To: <5158.1287086789@localhost> MIME-Version: 1.0 Message-Id: <201010151045.45630.hverkuil@xs4all.nl> 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 15 Oct 2010 08:46:37 +0000 (UTC) diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 32575a6..26d39c4 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c @@ -222,8 +222,8 @@ static int v4l2_ioctl(struct inode *inode, struct file *filp, if (!vdev->fops->ioctl) return -ENOTTY; - /* Allow ioctl to continue even if the device was unregistered. - Things like dequeueing buffers might still be useful. */ + if (!video_is_registered(vdev)) + return -ENODEV; return vdev->fops->ioctl(filp, cmd, arg); } @@ -234,8 +234,8 @@ static long v4l2_unlocked_ioctl(struct file *filp, if (!vdev->fops->unlocked_ioctl) return -ENOTTY; - /* Allow ioctl to continue even if the device was unregistered. - Things like dequeueing buffers might still be useful. */ + if (!video_is_registered(vdev)) + return -ENODEV; return vdev->fops->unlocked_ioctl(filp, cmd, arg); }