Re: [PATCH] media: i2c: Annotate struct i2c_atr with __counted_by

2023-09-24 Thread Wolfram Sang
; (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family > functions). > > As found with Coccinelle[1], add __counted_by for struct i2c_atr. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Wolfram Sa

Re: [PATCH] i2c: mux: demux-pinctrl: Annotate struct i2c_demux_pinctrl_priv with __counted_by

2023-09-24 Thread Wolfram Sang
lexible array member, move its initialization earlier. > > [1] > https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Wolfram Sang > Cc: Peter Rosin > Cc: linux-...@vger.kernel.org > Signed-off-by: Kees Cook Fixed a blank line and applied

Re: [PATCH] i2c: replace deprecated strncpy

2023-09-22 Thread Wolfram Sang
On Wed, Sep 20, 2023 at 11:07:35AM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We should prefer more robust and less ambiguous string interfaces. > > `info.type` is expected to be NUL-terminated judging by its use in > `i2c_new_clien

Re: [PATCH] i2c: cp2615: replace deprecated strncpy with strscpy

2023-09-22 Thread Wolfram Sang
On Wed, Sep 20, 2023 at 08:08:52AM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We should prefer more robust and less ambiguous string interfaces. > > We expect name to be NUL-terminated based on its numerous uses with > functions tha