Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: f0e53aadd702 ("drm/xe: Support for I2C attached MCUs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/65825d00-81ab-4665-af51-4fff6786a250@sabinyo.mountain
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit 2f264d58cc805a3cefc6b98097f90fbc388136ef)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

authored by

Dan Carpenter and committed by
Rodrigo Vivi
2bd98602 6aaceed7

+2 -2
+2 -2
drivers/gpu/drm/xe/xe_i2c.c
··· 96 96 int ret; 97 97 98 98 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); 101 101 102 102 /* 103 103 * Not using platform_device_register_full() here because we don't have