]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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:49:28 +0000 (14:49 -0700)
commit4fe5efbe4de66c283385dbb08e2adf6b6d60647a
treecf6461ffa0d375fc6b2417fd01733bb7b9209f8d
parent8348de5dc44bd911cc7b2e731cc5ec04085cda65
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