Skip to content

Commit

Permalink
intel_ips: potential null dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Matthew Garrett committed Aug 16, 2010
1 parent 2e0ee69 commit 52d7ee5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/platform/x86/intel_ips.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 52d7ee5

Please sign in to comment.