From patchwork Tue Nov 17 06:47:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TsODwqltZXRoIE3Dg8KhcnRvbg==?= X-Patchwork-Id: 60576 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAH6lmBL003581 for ; Tue, 17 Nov 2009 06:47:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753884AbZKQGrl (ORCPT ); Tue, 17 Nov 2009 01:47:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753921AbZKQGrl (ORCPT ); Tue, 17 Nov 2009 01:47:41 -0500 Received: from mail01d.mail.t-online.hu ([84.2.42.6]:61201 "EHLO mail01d.mail.t-online.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753684AbZKQGrk (ORCPT ); Tue, 17 Nov 2009 01:47:40 -0500 Received: from [192.168.1.64] (dsl5402C471.pool.t-online.hu [84.2.196.113]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail01d.mail.t-online.hu (Postfix) with ESMTPSA id 19EEB7586EC; Tue, 17 Nov 2009 07:47:05 +0100 (CET) Message-ID: <4B02470C.7000205@freemail.hu> Date: Tue, 17 Nov 2009 07:47:40 +0100 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Jean-Francois Moine , V4L Mailing List Subject: [PATCH] gspca: add sanity check for mandatory operations X-DCC-mail.t-online.hu-Metrics: mail01d.mail.t-online.hu 32721; Body=2 Fuz1=2 Fuz2=2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff -r 182b5f8fa160 linux/drivers/media/video/gspca/gspca.c --- a/linux/drivers/media/video/gspca/gspca.c Sun Nov 15 10:05:30 2009 +0100 +++ b/linux/drivers/media/video/gspca/gspca.c Tue Nov 17 07:42:34 2009 +0100 @@ -2035,6 +2035,12 @@ return -ENODEV; } + /* check for mandatory operations */ + BUG_ON(!sd_desc->config); + BUG_ON(!sd_desc->init); + BUG_ON(!sd_desc->start); + BUG_ON(!sd_desc->pkt_scan); + /* create the device */ if (dev_size < sizeof *gspca_dev) dev_size = sizeof *gspca_dev;