summaryrefslogtreecommitdiffstats
path: root/drivers/video/tegra
diff options
context:
space:
mode:
authorNavneet Kumar <navneetk@nvidia.com>2017-05-23 21:42:07 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-30 22:35:38 -0400
commit39f5ad0b2a2566c4009b808163476f1cdbea5936 (patch)
tree8a177acbf99546fae412aec9a68eb469dd5b5831 /drivers/video/tegra
parentb88c52981ea0c7c92e07198efe1a0a0805ab9028 (diff)
video: tegra: dsi: fix out of bounds array access
fix out of bounds access on dsi_io_padctrl Change-Id: Ie3687f0d22a71b59ddb52ffb191b922d7319f010 Signed-off-by: Navneet Kumar <navneetk@nvidia.com> Reviewed-on: http://git-master/r/1488380 (cherry picked from commit 19c41f5276a203667615212341d2fe4fc72d93c4) Reviewed-on: https://git-master/r/1510960 Reviewed-by: Samuel Payne <spayne@nvidia.com> Tested-by: Samuel Payne <spayne@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bo Yan <byan@nvidia.com>
Diffstat (limited to 'drivers/video/tegra')
-rw-r--r--drivers/video/tegra/dc/dc.h9
-rw-r--r--drivers/video/tegra/dc/dsi.c18
2 files changed, 11 insertions, 16 deletions
diff --git a/drivers/video/tegra/dc/dc.h b/drivers/video/tegra/dc/dc.h
index 8b47064ec..691dcaa7d 100644
--- a/drivers/video/tegra/dc/dc.h
+++ b/drivers/video/tegra/dc/dc.h
@@ -331,11 +331,12 @@ enum {
331 DSI/DSIB pads' DPD for DSI_INSTANCE_1 can be enabled, respectively, 331 DSI/DSIB pads' DPD for DSI_INSTANCE_1 can be enabled, respectively,
332 * but in SW, sometimes pins from one pad can be used by 332 * but in SW, sometimes pins from one pad can be used by
333 * more than one module, so it may be dependent on board design. 333 * more than one module, so it may be dependent on board design.
334 * 0:A
335 * 1:B
336 * 2:C
337 * 3:D
334 */ 338 */
335#define DSI_DPD_EN (1 << 0) 339#define DSI_DPD_EN(i) (1 << i)
336#define DSIB_DPD_EN (1 << 1)
337#define DSIC_DPD_EN (1 << 2)
338#define DSID_DPD_EN (1 << 3)
339 340
340struct tegra_dsi_board_info { 341struct tegra_dsi_board_info {
341 u32 platform_boardid; 342 u32 platform_boardid;
diff --git a/drivers/video/tegra/dc/dsi.c b/drivers/video/tegra/dc/dsi.c
index d29048265..2ce6f841b 100644
--- a/drivers/video/tegra/dc/dsi.c
+++ b/drivers/video/tegra/dc/dsi.c
@@ -4498,18 +4498,12 @@ static int _tegra_dc_dsi_init(struct tegra_dc *dc)
4498 */ 4498 */
4499 if (!dsi->info.ganged_type && !dsi->info.dsi_csi_loopback && 4499 if (!dsi->info.ganged_type && !dsi->info.dsi_csi_loopback &&
4500 (dsi->info.controller_vs >= DSI_VS_1)) { 4500 (dsi->info.controller_vs >= DSI_VS_1)) {
4501 if ((dsi->info.dpd_dsi_pads & DSI_DPD_EN) && 4501 int i;
4502 dsi->dsi_io_padctrl[0]) 4502 for (i = 0; i < MAX_DSI_INSTANCE; i++) {
4503 padctrl_power_disable(dsi->dsi_io_padctrl[0]); 4503 if ((dsi->info.dpd_dsi_pads & DSI_DPD_EN(i)) &&
4504 if ((dsi->info.dpd_dsi_pads & DSIB_DPD_EN) && 4504 dsi->dsi_io_padctrl[i])
4505 dsi->dsi_io_padctrl[1]) 4505 padctrl_power_disable(dsi->dsi_io_padctrl[i]);
4506 padctrl_power_disable(dsi->dsi_io_padctrl[1]); 4506 }
4507 if ((dsi->info.dpd_dsi_pads & DSIC_DPD_EN) &&
4508 dsi->dsi_io_padctrl[2])
4509 padctrl_power_disable(dsi->dsi_io_padctrl[2]);
4510 if ((dsi->info.dpd_dsi_pads & DSID_DPD_EN) &&
4511 dsi->dsi_io_padctrl[3])
4512 padctrl_power_disable(dsi->dsi_io_padctrl[3]);
4513 } 4507 }
4514 4508
4515 /* 4509 /*