From: Anton Vorontsov Date: Tue, 7 Sep 2010 13:31:49 +0000 (+0400) Subject: base/platform: Safe handling for NULL platform data and resources X-Git-Tag: v2.6.37-rc1~156^2~21 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cfc64ceb6222aabec640ba76e89529a8fc2c1f0;p=pandora-kernel.git 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: Anton Vorontsov Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed