提交 900ed72c 编写于 作者: D Dan Carpenter 提交者: Alexandre Belloni

rtc: gamecube: Fix an IS_ERR() vs NULL check

The devm_kzalloc() function returns NULL on error, it doesn't return
error pointers.

Fixes: 86559400 ("rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Signed-off-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220107073340.GF22086@kili
上级 7372971c
......@@ -319,8 +319,8 @@ static int gamecube_rtc_probe(struct platform_device *pdev)
int ret;
d = devm_kzalloc(dev, sizeof(struct priv), GFP_KERNEL);
if (IS_ERR(d))
return PTR_ERR(d);
if (!d)
return -ENOMEM;
d->iob = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(d->iob))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册