]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: i2c: vgxy61: Check return value of devm_gpiod_get_optional() in vgxy61_probe()
authorChen Ni <nichen@iscas.ac.cn>
Fri, 30 Jan 2026 04:20:43 +0000 (12:20 +0800)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 11 Mar 2026 00:05:38 +0000 (01:05 +0100)
commitdab65dfbf9c8beb325577c35450c9d363f423f44
treefcf7e0b3ead98de794aafb083213f1cb6e78c649
parentc8e0585dce5df525308f0fba40b618df03aaf7fc
media: i2c: vgxy61: Check return value of devm_gpiod_get_optional() in vgxy61_probe()

The devm_gpiod_get_optional() function may return an error pointer
(ERR_PTR) in case of a genuine failure during GPIO acquisition,
not just NULL which indicates the legitimate absence of an optional
GPIO.

Add an IS_ERR() check after the function call to catch such errors and
propagate them to the probe function, ensuring the driver fails to load
safely rather than proceeding with an invalid pointer.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/vgxy61.c