[CPUFREQ] Check return value of cpufreq_cpu_get in cpufreq_stats
authorDave Jones <davej@redhat.com>
Thu, 27 Oct 2005 23:02:06 +0000 (16:02 -0700)
committerDave Jones <davej@redhat.com>
Thu, 27 Oct 2005 23:02:06 +0000 (16:02 -0700)
commitbc7b26fd7ca5e0c6e769d3886c022f0a98fd88ec
tree19f23041be60367024f292780ba3e79ff3259fc8
parente98df50c5200ae3c748d69002a8827afc9d2eae2
[CPUFREQ] Check return value of cpufreq_cpu_get in cpufreq_stats

This fixes an issue found in drivers/cpufreq/cpufreq_stats.c by Coverity.

Error reported:
CID: 2642
Checker: NULL_RETURNS (help)
File: /export2/p4-coverity/mc2/linux26/drivers/cpufreq/cpufreq_stats.c
Function: cpufreq_stats_create_table
Description: Dereferencing NULL value "data"

Patch description:
 The return of cpufreq_cpu_get can be NULL, check return code and return
 -EINVAL if it is NULL.

Signed-off-by: Jayachandran C. <c.jayachandran at gmail.com>
Signed-off-by: Dave Jones <davej@redhat.com>
drivers/cpufreq/cpufreq_stats.c