]> git.karo-electronics.de Git - karo-tx-linux.git/commit
thermal: Fix potential NULL pointer accesses
authorGuenter Roeck <linux@roeck-us.net>
Wed, 8 Aug 2012 05:36:45 +0000 (22:36 -0700)
committerZhang Rui <rui.zhang@intel.com>
Thu, 9 Aug 2012 01:14:36 +0000 (09:14 +0800)
commit449488ced03a3552b45d5993c06f6f3e422308b7
treead10d76c086ea993121e959aced2370c6b704f8d
parent33631dfe6eab694aa56e39aadebb1b82fd9886e0
thermal: Fix potential NULL pointer accesses

The type parameter in thermal_zone_device_register and
thermal_cooling_device_register can be NULL, indicating that no sysfs attribute
for the type should be created. Only call strlen() and strcpy() on type if it is
not NULL.

This patch addresses Coverity #102180 and #102182: Dereference before null check

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/thermal/thermal_sys.c