Skip to content

Commit 900ed72

Browse files
Dan Carpenteralexandrebelloni
authored andcommitted
rtc: gamecube: Fix an IS_ERR() vs NULL check
The devm_kzalloc() function returns NULL on error, it doesn't return error pointers. Fixes: 8655940 ("rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Emmanuel Gil Peyrot <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/20220107073340.GF22086@kili
1 parent 7372971 commit 900ed72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/rtc/rtc-gamecube.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ static int gamecube_rtc_probe(struct platform_device *pdev)
319319
int ret;
320320

321321
d = devm_kzalloc(dev, sizeof(struct priv), GFP_KERNEL);
322-
if (IS_ERR(d))
323-
return PTR_ERR(d);
322+
if (!d)
323+
return -ENOMEM;
324324

325325
d->iob = devm_platform_ioremap_resource(pdev, 0);
326326
if (IS_ERR(d->iob))

0 commit comments

Comments
 (0)