drivers/rtc/rtc-max8998.c: check for pdata presence before dereferencing
authorTomasz Figa <t.figa@samsung.com>
Fri, 24 May 2013 22:55:35 +0000 (15:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 May 2013 23:22:53 +0000 (16:22 -0700)
commit43c523bff7c3b47506d536c10637be8399dfd85f
tree8d42a0a165fde104013254cfcfcdee74fb612797
parentb4ca2b4b577c3530e34dcfaafccb2cc680ce95d1
drivers/rtc/rtc-max8998.c: check for pdata presence before dereferencing

Currently the driver can crash with a NULL pointer dereference if no
pdata is provided, despite of successful registration of the MFD part.
This patch fixes the problem by adding a NULL check before dereferencing
the pdata pointer.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Sachin Kamat <sachin.kamat@linaro.org>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-max8998.c