Bill XIE has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74179 )
Change subject: nb/intel/gm45: Prevent null-deref in get_blc_pwm_freq_value() ......................................................................
nb/intel/gm45: Prevent null-deref in get_blc_pwm_freq_value()
IF its first call is get_blc_pwm_freq_value(NULL), null dereference will occur.
Now when the parameter is NULL, it will return the value of the static blc_pwm_freq directly, so the original behavior is kept.
Signed-off-by: Bill XIE persmule@hardenedlinux.org Change-Id: I32354aa0fe1a3ca725c2031f973ffad0bda81ad5 --- M src/northbridge/intel/gm45/gma.c 1 file changed, 18 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/79/74179/1
diff --git a/src/northbridge/intel/gm45/gma.c b/src/northbridge/intel/gm45/gma.c index 7df9106..8043822 100644 --- a/src/northbridge/intel/gm45/gma.c +++ b/src/northbridge/intel/gm45/gma.c @@ -67,7 +67,8 @@ int i; int blc_array_len;
- if (blc_pwm_freq > 0) + /* Prevent null-deref on strcmp() below */ + if (blc_pwm_freq > 0 || !edid_ascii_string) return blc_pwm_freq;
blc_array_len = get_blc_values(&blc_pwm);