projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ee85bb5
)
rtc: ac100: Add NULL checking for devm_kzalloc call
author
Axel Lin
<axel.lin@ingics.com>
Fri, 9 Sep 2016 10:03:54 +0000
(18:03 +0800)
committer
Alexandre Belloni
<alexandre.belloni@free-electrons.com>
Wed, 21 Sep 2016 22:14:41 +0000
(
00:14
+0200)
devm_kzalloc can return NULL, add NULL checking to prevent NULL pointer
dereference.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-ac100.c
patch
|
blob
|
history
diff --git
a/drivers/rtc/rtc-ac100.c
b/drivers/rtc/rtc-ac100.c
index 2d0bb02a25d952fe1ea08e6b412fc0ad5ebe5379..9e336184491cbd1b1e80c47cddbf346c24665a63 100644
(file)
--- a/
drivers/rtc/rtc-ac100.c
+++ b/
drivers/rtc/rtc-ac100.c
@@
-554,6
+554,9
@@
static int ac100_rtc_probe(struct platform_device *pdev)
int ret;
chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
+ if (!chip)
+ return -ENOMEM;
+
platform_set_drvdata(pdev, chip);
chip->dev = &pdev->dev;
chip->regmap = ac100->regmap;