mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
rtc: ac100: Add NULL checking for devm_kzalloc call
devm_kzalloc can return NULL, add NULL checking to prevent NULL pointer dereference. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
This commit is contained in:
parent
ee85bb5bbe
commit
473195f80f
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue