From patchwork Sat May 2 16:04:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 21560 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 n42G4cLk030218 for ; Sat, 2 May 2009 16:04:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751728AbZEBQEg (ORCPT ); Sat, 2 May 2009 12:04:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754568AbZEBQEg (ORCPT ); Sat, 2 May 2009 12:04:36 -0400 Received: from smtp-vbr13.xs4all.nl ([194.109.24.33]:2208 "EHLO smtp-vbr13.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728AbZEBQEf (ORCPT ); Sat, 2 May 2009 12:04:35 -0400 Received: from tschai.lan (cm-84.208.85.194.getinternet.no [84.208.85.194]) (authenticated bits=0) by smtp-vbr13.xs4all.nl (8.13.8/8.13.8) with ESMTP id n42G4Ih9049066 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 2 May 2009 18:04:18 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) From: Hans Verkuil To: saeed bishara Subject: Re: cafe driver need to initialize the chip->ident Date: Sat, 2 May 2009 18:04:17 +0200 User-Agent: KMail/1.9.9 Cc: video4linux-list@redhat.com, linux-media@vger.kernel.org References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200905021804.17908.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 On Thursday 30 April 2009 14:35:58 saeed bishara wrote: > Hi, > The cafe_cam_init declares un-initialized v4l2_dbg_chip_ident > structure, then it uses the chip.ident to test if the sensor is known. > but, this field is never initialized and it my get random value, > then later it used by the v4l2_chip_ident_i2c_client function. > I think this is bug and it must be fixed by initializing the ident > field with zero. > I'm using kernel 2.6.29.1 > saeed Thanks! This is indeed wrong and I'll fix it. I think it is sufficient to apply this patch: Can you confirm this? If it works, then I'll merge this patch and see if I can get it into the 2.6.29 stable series. Regards, Hans --- cafe_ccic.c.orig 2009-05-02 17:57:08.000000000 +0200 +++ cafe_ccic.c 2009-05-02 17:57:37.000000000 +0200 @@ -868,6 +868,7 @@ ret = __cafe_cam_reset(cam); if (ret) goto out; + chip.ident = V4L2_IDENT_NONE; chip.match.type = V4L2_CHIP_MATCH_I2C_ADDR; chip.match.addr = cam->sensor->addr; ret = __cafe_cam_cmd(cam, VIDIOC_DBG_G_CHIP_IDENT, &chip);