device property: fix potential NULL pointer dereference
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 5 Aug 2015 13:51:11 +0000 (16:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Oct 2015 21:43:22 +0000 (14:43 -0700)
commitbff1c3b39ae30ec13d10a581655ec07af5c76608
tree6ce3663be8108d945b95828506158b3835962d5d
parent453995c8b13b02acc4e82c718c13c98373167655
device property: fix potential NULL pointer dereference

commit ecc87eed7beeb50c0be0b73322d62135277ea2b0 upstream.

In device_add_property_set() we check pset parameter for a NULL, but few lines
later we do a pointer arithmetic without check that will crash kernel in the
set_secondary_fwnode().

Here we check if pset parameter is NULL and return immediately.

Fixes: 16ba08d5c9ec (device property: Introduce firmware node type for platform data)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/property.c