diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-04-04 03:00:00 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-04-16 00:18:38 -0400 |
commit | 8f802da33a842bc9e511d2a9c8259fbee8a6d17e (patch) | |
tree | 735cb5dfbf57a4bd994b36411aa9d1bbbdc19db6 /drivers | |
parent | b5cfeed6cf90a4bb619b7ac640ba1a6dd002364d (diff) |
video: exynos_dp: replace char pointer with char array for adjust_request variable
The char pointer for adjust_request variable is replaced with char array
to fix possible null pointer dereference when clock recovery is failed.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/exynos/exynos_dp_core.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/video/exynos/exynos_dp_core.c b/drivers/video/exynos/exynos_dp_core.c index 2a4481cf260c..6e9f3ce2a4b1 100644 --- a/drivers/video/exynos/exynos_dp_core.c +++ b/drivers/video/exynos/exynos_dp_core.c | |||
@@ -478,7 +478,7 @@ static int exynos_dp_process_clock_recovery(struct exynos_dp_device *dp) | |||
478 | int lane_count; | 478 | int lane_count; |
479 | u8 buf[5]; | 479 | u8 buf[5]; |
480 | 480 | ||
481 | u8 *adjust_request; | 481 | u8 adjust_request[2]; |
482 | u8 voltage_swing; | 482 | u8 voltage_swing; |
483 | u8 pre_emphasis; | 483 | u8 pre_emphasis; |
484 | u8 training_lane; | 484 | u8 training_lane; |
@@ -493,8 +493,8 @@ static int exynos_dp_process_clock_recovery(struct exynos_dp_device *dp) | |||
493 | /* set training pattern 2 for EQ */ | 493 | /* set training pattern 2 for EQ */ |
494 | exynos_dp_set_training_pattern(dp, TRAINING_PTN2); | 494 | exynos_dp_set_training_pattern(dp, TRAINING_PTN2); |
495 | 495 | ||
496 | adjust_request = link_status + (DPCD_ADDR_ADJUST_REQUEST_LANE0_1 | 496 | adjust_request[0] = link_status[4]; |
497 | - DPCD_ADDR_LANE0_1_STATUS); | 497 | adjust_request[1] = link_status[5]; |
498 | 498 | ||
499 | exynos_dp_get_adjust_train(dp, adjust_request); | 499 | exynos_dp_get_adjust_train(dp, adjust_request); |
500 | 500 | ||
@@ -566,7 +566,7 @@ static int exynos_dp_process_equalizer_training(struct exynos_dp_device *dp) | |||
566 | u8 buf[5]; | 566 | u8 buf[5]; |
567 | u32 reg; | 567 | u32 reg; |
568 | 568 | ||
569 | u8 *adjust_request; | 569 | u8 adjust_request[2]; |
570 | 570 | ||
571 | udelay(400); | 571 | udelay(400); |
572 | 572 | ||
@@ -575,8 +575,8 @@ static int exynos_dp_process_equalizer_training(struct exynos_dp_device *dp) | |||
575 | lane_count = dp->link_train.lane_count; | 575 | lane_count = dp->link_train.lane_count; |
576 | 576 | ||
577 | if (exynos_dp_clock_recovery_ok(link_status, lane_count) == 0) { | 577 | if (exynos_dp_clock_recovery_ok(link_status, lane_count) == 0) { |
578 | adjust_request = link_status + (DPCD_ADDR_ADJUST_REQUEST_LANE0_1 | 578 | adjust_request[0] = link_status[4]; |
579 | - DPCD_ADDR_LANE0_1_STATUS); | 579 | adjust_request[1] = link_status[5]; |
580 | 580 | ||
581 | if (exynos_dp_channel_eq_ok(link_status, lane_count) == 0) { | 581 | if (exynos_dp_channel_eq_ok(link_status, lane_count) == 0) { |
582 | /* traing pattern Set to Normal */ | 582 | /* traing pattern Set to Normal */ |