From patchwork Thu Feb 19 16:42:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominic Curran X-Patchwork-Id: 7998 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 n1JGgtLd009497 for ; Thu, 19 Feb 2009 16:42:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752301AbZBSQm0 (ORCPT ); Thu, 19 Feb 2009 11:42:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754156AbZBSQm0 (ORCPT ); Thu, 19 Feb 2009 11:42:26 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:54995 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752301AbZBSQmZ (ORCPT ); Thu, 19 Feb 2009 11:42:25 -0500 Received: from dlep36.itg.ti.com ([157.170.170.91]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n1JGgJe7024289 for ; Thu, 19 Feb 2009 10:42:24 -0600 Received: from gromit.am.dhcp.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id n1JGgJ2j024025 for ; Thu, 19 Feb 2009 10:42:19 -0600 (CST) From: Dominic Curran To: "linux-omap" Subject: [OMAPZOOM] ISP: Fix indexing bug in csi2 module. Date: Thu, 19 Feb 2009 10:42:18 -0600 User-Agent: KMail/1.9.6 (enterprise 0.20071204.744707) MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200902191042.18843.dcurran@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Dominic Curran Subject: [OMAPZOOM] ISP: Fix indexing bug in csi2 module. This patch fixes an indexing bug in the CSI2 module. The functions: isp_csi2_timings_update(..) isp_csi2_timings_get(..) expect either a 1 or 2 which references the complexio number being referenced. The bug was that they were being passed a 0 & 1. The issue was originally found by HP. Signed-off-by: Dominic Curran Acked-by: Sergio Aguirre --- drivers/media/video/isp/ispcsi2.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: omapzoom04/drivers/media/video/isp/ispcsi2.c =================================================================== --- omapzoom04.orig/drivers/media/video/isp/ispcsi2.c +++ omapzoom04/drivers/media/video/isp/ispcsi2.c @@ -1526,7 +1526,7 @@ int isp_csi2_timings_config_forcerxmode( struct isp_csi2_timings_cfg *currtimings; struct isp_csi2_timings_cfg_update *currtimings_u; - if (io > 2) { + if (io < 1 || io > 2) { printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n"); return -EINVAL; } @@ -1552,7 +1552,7 @@ int isp_csi2_timings_config_stopstate_16 struct isp_csi2_timings_cfg *currtimings; struct isp_csi2_timings_cfg_update *currtimings_u; - if (io > 2) { + if (io < 1 || io > 2) { printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n"); return -EINVAL; } @@ -1578,7 +1578,7 @@ int isp_csi2_timings_config_stopstate_4x struct isp_csi2_timings_cfg *currtimings; struct isp_csi2_timings_cfg_update *currtimings_u; - if (io > 2) { + if (io < 1 || io > 2) { printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n"); return -EINVAL; } @@ -1604,7 +1604,7 @@ int isp_csi2_timings_config_stopstate_cn struct isp_csi2_timings_cfg *currtimings; struct isp_csi2_timings_cfg_update *currtimings_u; - if (io > 2) { + if (io < 1 || io > 2) { printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n"); return -EINVAL; } @@ -1636,7 +1636,7 @@ int isp_csi2_timings_update(u8 io, bool struct isp_csi2_timings_cfg_update *currtimings_u; u32 reg; - if (io > 2) { + if (io < 1 || io > 2) { printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n"); return -EINVAL; } @@ -1706,7 +1706,7 @@ int isp_csi2_timings_get(u8 io) struct isp_csi2_timings_cfg_update *currtimings_u; u32 reg; - if (io > 2) { + if (io < 1 || io > 2) { printk(KERN_ERR "CSI2 - Timings config: Invalid IO number\n"); return -EINVAL; } @@ -1758,7 +1758,7 @@ int isp_csi2_timings_update_all(bool for { int i; - for (i = 0; i < 2; i++) + for (i = 1; i < 3; i++) isp_csi2_timings_update(i, force_update); return 0; } @@ -1772,7 +1772,7 @@ int isp_csi2_timings_get_all(void) { int i; - for (i = 0; i < 2; i++) + for (i = 1; i < 3; i++) isp_csi2_timings_get(i); return 0; }