linux/drivers/staging/greybus
Dan Carpenter 40f0170f22 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>
History 2024-03-26 18:20:06 -04:00
..
Documentation staging: greybus: remove license "boilerplate" 2019-08-27 19:02:26 +02:00
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 staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
audio_apbridgea.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
audio_apbridgea.h staging: Replace zero-length array with flexible-array member 2020-02-23 19:18:54 +01:00
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 staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
audio_helper.c staging: greybus: audio_helper: Use snd_ctl_remove_id() 2023-07-20 10:00:39 +02:00
audio_helper.h staging: greybus: audio: Add helper APIs for dynamic audio modules 2020-07-29 16:40:09 +02:00
audio_manager.c staging: greybus: use after free in gb_audio_manager_remove_all() 2020-02-10 08:52:33 -08:00
audio_manager.h staging: greybus: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
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: correct SPDX License Identifier 2018-11-09 09:49:02 -08:00
audio_manager_sysfs.c staging: greybus: minor code style fix 2021-02-13 22:37:50 +01:00
audio_module.c staging/greybus: eliminate use of NAME_SIZE for strings 2021-03-10 09:25:33 +01:00
audio_topology.c staging: greybus: fix line ending with '(' 2023-03-22 10:09:49 +01:00
authentication.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
bootrom.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
camera.c staging: greybus: camera: Switch to memdup_user_nul() 2021-04-02 14:56:38 +02:00
firmware.h staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
fw-core.c staging: greybus: fix alignment of open parenthesis 2023-08-22 15:47:55 +02:00
fw-download.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
fw-management.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
gb-camera.h staging: greybus: fix up SPDX comment in .h files 2019-08-27 19:02:18 +02:00
gbphy.c driver core: make struct bus_type.uevent() take a const * 2023-01-27 13:45:52 +01:00
gbphy.h staging: greybus: Add identifier name to function definition argument 2020-08-18 16:07:17 +02:00
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 staging: greybus: remove license "boilerplate" 2019-08-27 19:02:26 +02:00
hid.c staging: greybus: hid: Constify lowlevel HID driver 2023-02-06 15:08:45 +01:00
i2c.c staging: greybus: i2c: remove unused pointers 2020-03-17 12:47:24 +01:00
Kconfig staging: greybus: audio: Enable GB codec, audio module compilation. 2020-07-29 16:40:26 +02:00
light.c staging: greybus: fix get_channel_from_mode() failure path 2024-03-26 18:20:06 -04:00
log.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
loopback.c drivers: remove struct module * setting from struct class 2023-03-17 15:16:27 +01:00
Makefile staging: greybus: audio: Enable GB codec, audio module compilation. 2020-07-29 16:40:26 +02:00
power_supply.c staging: greybus: Switch from strlcpy to strscpy 2021-02-04 17:16:06 +01:00
pwm.c pwm: Changes for v6.6-rc1 2023-09-07 18:05:58 -07:00
raw.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
sdio.c staging: greybus: Remove redundant 'flush_workqueue()' calls 2022-02-15 17:05:56 +01:00
spi.c staging: greybus: move core include files to include/linux/greybus/ 2019-08-27 19:02:59 +02:00
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 staging: greybus: fix up SPDX comment in .h files 2019-08-27 19:02:18 +02:00
TODO staging: greybus: Add TODO item about modernizing the pwm code 2020-12-09 15:49:04 +01:00
uart.c tty: make tty_operations::write()'s count size_t 2023-08-11 21:12:46 +02:00
usb.c staging: greybus: Replace zero-length array by DECLARE_FLEX_ARRAY() helper 2023-01-17 19:18:47 +01:00
vibrator.c drivers: remove struct module * setting from struct class 2023-03-17 15:16:27 +01:00