aboutsummaryrefslogtreecommitdiffstats
path: root/xen/drivers
diff options
context:
space:
mode:
authorTim Deegan <tim@xen.org>2013-09-12 13:09:35 +0100
committerTim Deegan <tim@xen.org>2013-09-12 17:48:01 +0100
commitcadbe2f9e768585fad52156be2433d49ec9feaf1 (patch)
tree69c75ce65cf501133e5b251f1e9fdd3fd648c2bf /xen/drivers
parente58015acaf53b179847db94524fb2a9f4399b5e6 (diff)
downloadxen-cadbe2f9e768585fad52156be2433d49ec9feaf1.tar.gz
xen-cadbe2f9e768585fad52156be2433d49ec9feaf1.tar.bz2
xen-cadbe2f9e768585fad52156be2433d49ec9feaf1.zip
acpi/pmstat: fix check for empty name strings.
These 'name' strings are actually arrays in their structs. So the address is never NULL: instead, we should check the first character to detect cases where the field wasn't initialized. Coverity CID 1055633 Signed-off-by: Tim Deegan <tim@xen.org> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/drivers')
-rw-r--r--xen/drivers/acpi/pmstat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index f8a9c85eb9..daac2da57f 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -264,13 +264,13 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
op->u.get_para.scaling_max_freq = policy->max;
op->u.get_para.scaling_min_freq = policy->min;
- if ( cpufreq_driver->name )
+ if ( cpufreq_driver->name[0] )
strlcpy(op->u.get_para.scaling_driver,
cpufreq_driver->name, CPUFREQ_NAME_LEN);
else
strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
- if ( policy->governor->name )
+ if ( policy->governor->name[0] )
strlcpy(op->u.get_para.scaling_governor,
policy->governor->name, CPUFREQ_NAME_LEN);
else