jz4740-battery: Check if platform_data is supplied
Currently platform_data is dereferenced without checking whether it is actually set, which can lead to kernel crashes. This patch adds a check which will abort the drivers probe function gracefully if no platform_data is supplied. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NAnton Vorontsov <cbouatmailru@gmail.com>
Showing
想要评论请 注册 或 登录