lkml.org 
[lkml]   [2020]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][next][V3] rtc: ds1307: check for failed memory allocation on wdt
On 03/04/2020 12:04:37+0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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: fd90d48db037 ("rtc: ds1307: add support for watchdog timer on ds1388")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>
> V2: move error exit label and remove a return statement, thanks to
> Walter Harms for spotting this clean up.
> V3: simplify, just bail out and return on detecting the out of memory
> condition
>
> ---
>
> drivers/rtc/rtc-ds1307.c | 2 ++
> 1 file changed, 2 insertions(+)
>
Applied, thanks.

--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

\
 
 \ /
  Last update: 2020-04-03 13:40    [W:0.038 / U:4.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site