Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5cfc64ce authored by Anton Vorontsov's avatar Anton Vorontsov Committed by Greg Kroah-Hartman
Browse files

base/platform: Safe handling for NULL platform data and resources



Some users of platform_device_add_{data,resources}() assume that
NULL data and resources will be handled specially, i.e. just ignored.

But the platform core ends up calling kmemdup(NULL, 0, ...), which
returns a non-NULL result (i.e. ZERO_SIZE_PTR), which causes drivers
to oops on a valid code, something like:

  if (platform_data)
  	stuff = platform_data->stuff;

This patch makes the platform core a bit more safe for such cases.

Signed-off-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 87544653
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment