Skip to content

Commit 2bd9860

Browse files
Dan Carpenterrodrigovivi
authored andcommitted
drm/xe: Fix a NULL vs IS_ERR() bug in xe_i2c_register_adapter()
The fwnode_create_software_node() function returns error pointers. It never returns NULL. Update the checks to match. Fixes: f0e53aa ("drm/xe: Support for I2C attached MCUs") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]> (cherry picked from commit 2f264d58cc805a3cefc6b98097f90fbc388136ef) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 6aaceed commit 2bd9860

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/xe/xe_i2c.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ static int xe_i2c_register_adapter(struct xe_i2c *i2c)
9696
int ret;
9797

9898
fwnode = fwnode_create_software_node(xe_i2c_adapter_properties, NULL);
99-
if (!fwnode)
100-
return -ENOMEM;
99+
if (IS_ERR(fwnode))
100+
return PTR_ERR(fwnode);
101101

102102
/*
103103
* Not using platform_device_register_full() here because we don't have

0 commit comments

Comments
 (0)