]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: ds1307: check for failed memory allocation on wdt
authorColin Ian King <colin.king@canonical.com>
Fri, 3 Apr 2020 11:04:37 +0000 (12:04 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 3 Apr 2020 11:38:24 +0000 (13:38 +0200)
commit2447aae8c52190eeae944b62fbcc4db1b04bba38
treea15925b39a3d5edf37280b1eb5312804774cd372
parent7c4d2e6e98224388d369a2a4f9046a636d74d23e
rtc: ds1307: check for failed memory allocation on wdt

Currently a failed memory allocation will lead to a null pointer
dereference on point wdt.  Fix this by checking for a failed
allocation and just returning.

Addresses-Coverity: ("Dereference null return")
Fixes: b2f4b0e98c7e ("rtc: ds1307: add support for watchdog timer on ds1388")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200403110437.57420-1-colin.king@canonical.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ds1307.c