linux-stable/drivers/staging/greybus
Dan Carpenter 7fad138dcb staging: greybus: fix get_channel_from_mode() failure path
[ Upstream commit 34164202a5 ]

The get_channel_from_mode() function is supposed to return the channel
which matches the mode.  But it has a bug where if it doesn't find a
matching channel then it returns the last channel.  It should return
NULL instead.

Also remove an unnecessary NULL check on "channel".

Fixes: 2870b52bae ("greybus: lights: add lights implementation")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/379c0cb4-39e0-4293-8a18-c7b1298e5420@moroto.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:17:30 -04:00
..
Documentation
arche-apb-ctrl.c staging: greybus: arche-apb-ctrl: Convert to platform remove callback returning void 2023-04-03 21:49:54 +02:00
arche-platform.c staging: Explicitly include correct DT includes 2023-07-27 10:01:07 +02:00
arche_platform.h
audio_apbridgea.c
audio_apbridgea.h
audio_codec.c staging: greybus: Avoid abusing controls_rwsem 2023-07-20 10:02:59 +02:00
audio_codec.h staging: greybus: Avoid abusing controls_rwsem 2023-07-20 10:02:59 +02:00
audio_gb.c
audio_helper.c staging: greybus: audio_helper: Use snd_ctl_remove_id() 2023-07-20 10:00:39 +02:00
audio_helper.h
audio_manager.c
audio_manager.h
audio_manager_module.c staging: greybus: Inline gb_audio_manager_module() 2023-03-25 09:54:52 +01:00
audio_manager_private.h staging: greybus: Modify lines end with a '(' 2023-10-17 15:42:27 +02:00
audio_manager_sysfs.c
audio_module.c
audio_topology.c staging: greybus: fix line ending with '(' 2023-03-22 10:09:49 +01:00
authentication.c staging: greybus: authentication: make cap_class constant 2023-10-06 15:39:05 +02:00
bootrom.c staging: greybus: bootrom: fixed prefer using ftrace warning 2023-10-25 12:56:04 +02:00
camera.c staging: greybus: camera: Modify lines end with a '(' 2023-10-25 12:56:03 +02:00
firmware.h
fw-core.c staging: greybus: fix alignment of open parenthesis 2023-08-22 15:47:55 +02:00
fw-download.c
fw-management.c staging: greybus: fw-management: make fw_mgmt_class constant 2023-10-06 15:39:09 +02:00
gb-camera.h
gbphy.c
gbphy.h
gpio.c staging: greybus: Inline gpio_chip_to_gb_gpio_controller() 2023-03-25 09:54:52 +01:00
greybus_authentication.h staging: greybus: remove unnecessary blank line 2023-03-25 09:52:51 +01:00
greybus_firmware.h
hid.c
i2c.c staging: greybus: Don't let i2c adapters declare I2C_CLASS_SPD support if they support I2C_CLASS_HWMON 2024-01-18 21:10:41 +01:00
Kconfig
light.c staging: greybus: fix get_channel_from_mode() failure path 2024-03-26 18:17:30 -04:00
log.c
loopback.c drivers: remove struct module * setting from struct class 2023-03-17 15:16:27 +01:00
Makefile
power_supply.c
pwm.c pwm: Manage owner assignment implicitly for drivers 2023-10-13 10:07:17 +02:00
raw.c staging: greybus: Add __counted_by for struct apr_rx_buf and use struct_size() 2023-10-15 18:19:41 +02:00
sdio.c
spi.c
spilib.c staging: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:05 +00:00
spilib.h
TODO
uart.c tty: make tty_operations::write()'s count size_t 2023-08-11 21:12:46 +02:00
usb.c
vibrator.c drivers: remove struct module * setting from struct class 2023-03-17 15:16:27 +01:00