History

drm/vgem: Fix return value check in vgem_init()

In case of error, the function platform_device_register_simple() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().

Wei Yongjun committed 9 years ago

Commit e8fa49b1 parent a18e6621 file · +2 −2Browse files

Unified · Split

drivers/gpu/drm/vgem/vgem_drv.c+2−2
@@ -438,8 +438,8 @@ static int __init vgem_init(void) · 437 unmodified lines
438 438
439 vgem_device->platform =439 vgem_device->platform =
440 platform_device_register_simple("vgem", -1, NULL, 0);440 platform_device_register_simple("vgem", -1, NULL, 0);
441 if (!vgem_device->platform) {441 if (IS_ERR(vgem_device->platform)) {
442 ret = -ENODEV;442 ret = PTR_ERR(vgem_device->platform);
443 goto out_fini;443 goto out_fini;
444 }444 }
445 445

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t