[PATCH] board: freescale: Replace invalid usage of sprintf by strcat

2024-07-10 Thread Francois Berder
buf was used as destination and as parameter to sprintf which triggers an undefined behaviour. This commit removes this usage of sprintf and uses strcat to append strings to buf variable. Signed-off-by: Francois Berder --- board/freescale/t208xqds/eth_t208xqds.c | 40

[PATCH] board: raspberrypi: Fix format specifier for printing rev_scheme

2024-07-09 Thread Francois Berder
rev_scheme is an unsigned integer and must not be printed as a signed integer. Signed-off-by: Francois Berder --- board/raspberrypi/rpi/rpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index d996eb0cf6

[PATCH] lib/slre: Fix memory leak if regex compilation fails

2023-11-13 Thread Francois Berder
Signed-off-by: Francois Berder --- lib/slre.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/slre.c b/lib/slre.c index e82a9e7635..e1a50443e0 100644 --- a/lib/slre.c +++ b/lib/slre.c @@ -686,6 +686,7 @@ int main(int argc, char *argv[]) } if (!slre_compile(, argv[1

[PATCH] firmware: scmi: Fix clearing variable

2023-10-10 Thread Francois Berder
The sess variable in open_channel was not entirely cleared to zero at the start of this function. This commit ensures that the entire struct is cleared. Signed-off-by: Francois Berder --- drivers/firmware/scmi/optee_agent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] board/km/cent2: Fix buffer overflow when fixing MAC address

2023-09-29 Thread Francois Berder
String "/soc/fman/ethernet@e8000" is 25 bytes long and not 24 due to extra byte for null character at the end. Signed-off-by: Francois Berder --- board/keymile/kmcent2/kmcent2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/keymile/kmcent2/kmcent2.c b/boa

[PATCH] clk: at91: Fix initializing arrays

2023-09-24 Thread Francois Berder
Arrays are not cleared entirely because ARRAY_SIZE returns the number of elements in an array, not the size in bytes. This commit fixes the calls to memset by providing the array size in bytes instead of the number of elements in the array. Signed-off-by: Francois Berder --- drivers/clk/at91

[PATCH] drivers: mediatek: Fix error handling in mtk_i2c_do_transfer

2023-09-08 Thread Francois Berder
Errors were handled only if an I2C transfer timed out and received a NACK which is very unlikely. This commit changes the condition such that errors are handled if an I2C transfer times out or received a NACK. Signed-off-by: Francois Berder --- drivers/i2c/mtk_i2c.c | 2 +- 1 file changed, 1

[PATCH v2] drivers: adc: fix return value if timeout occurs

2022-03-01 Thread Francois Berder
Because unsigned integers cannot be negative, timeout variable is never less than zero. Hence, checks in Amlogic Meson ADC driver to detect timeouts always evaluated to false. Fix that. Signed-off-by: Francois Berder --- Changes for v2: - Replace timeout handling logic

[PATCH] drivers: adc: fix return value if timeout occurs

2022-03-01 Thread Francois Berder
Because unsigned integers cannot be negative, timeout variable is never less than zero. Hence, checks in Amlogic Meson ADC driver to detect timeouts always evaluated to false. Fix that. Signed-off-by: Francois Berder --- drivers/adc/meson-saradc.c | 6 -- 1 file changed, 4 insertions(+), 2