]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/rtc/rtc-tps65910.c: fix potential NULL-pointer dereference
authorThierry Reding <treding@nvidia.com>
Fri, 8 Aug 2014 21:20:26 +0000 (14:20 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Aug 2014 22:57:20 +0000 (15:57 -0700)
commit0b76832bbda0f2a20494dd361c3a39a12321a4e5
tree4193e3ce968b9e444200bfdb402ac7a756eb2e33
parent7ac7ea9833696cfef2b19ef653a25057d9b8ef2a
drivers/rtc/rtc-tps65910.c: fix potential NULL-pointer dereference

The interrupt handler gets the driver data associated with the RTC
device and doesn't check it for validity.  This can cause a NULL pointer
being dereferenced when and interrupt fires before the driver data was
properly set up.

Fix this by setting the driver data earlier (before the interrupt is
requested).

Signed-off-by: Thierry Reding <treding@nvidia.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-tps65910.c