diff options
author | Dan Carpenter <error27@gmail.com> | 2010-08-08 00:01:12 +0200 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2010-08-16 17:54:29 +0200 |
commit | 52d7ee558d3babb4918eed6769f593adc1b6616e (patch) | |
tree | 89b54e76934e3d9c44fb8eb8e8647dc9a93350fd /drivers | |
parent | drivers/platform/x86: Adjust confusing if indentation (diff) | |
download | linux-52d7ee558d3babb4918eed6769f593adc1b6616e.tar.xz linux-52d7ee558d3babb4918eed6769f593adc1b6616e.zip |
intel_ips: potential null dereference
There is a potential NULL dereference of "limits." We can just return
NULL earlier to avoid it. The caller already handles NULL returns.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/platform/x86/intel_ips.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index fad59b69a69c..9024480a8228 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c @@ -1342,8 +1342,10 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips) limits = &ips_lv_limits; else if (strstr(boot_cpu_data.x86_model_id, "CPU U")) limits = &ips_ulv_limits; - else + else { dev_info(&ips->dev->dev, "No CPUID match found.\n"); + goto out; + } rdmsrl(TURBO_POWER_CURRENT_LIMIT, turbo_power); tdp = turbo_power & TURBO_TDP_MASK; |