mbox series

[v1,0/2] cmd: ubi: check 'updating' before calling ubi_more_update_data()

Message ID 20240616133426.123299-1-mmkurbanov@salutedevices.com
Headers show
Series cmd: ubi: check 'updating' before calling ubi_more_update_data() | expand

Message

Martin Kurbanov June 16, 2024, 1:34 p.m. UTC
If 0 is passed to the 'bytes' parameter in the ubi_start_update(),
there is no need to call the ubi_more_update_data(). Otherwise,
there will be a double-free of 'vol->upd_buf'.

Also check that the ubi_start_update() was called before calling
the ubi_more_update_data().

Martin Kurbanov (2):
  cmd: ubi: remove redundant initializations
  cmd: ubi: check 'updating' before calling ubi_more_update_data()

 cmd/ubi.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

Comments

Martin Kurbanov July 19, 2024, 10:43 a.m. UTC | #1
Hello. Please, ping

On 16.06.2024 16:34, Martin Kurbanov wrote:
> If 0 is passed to the 'bytes' parameter in the ubi_start_update(),
> there is no need to call the ubi_more_update_data(). Otherwise,
> there will be a double-free of 'vol->upd_buf'.
> 
> Also check that the ubi_start_update() was called before calling
> the ubi_more_update_data().
> 
> Martin Kurbanov (2):
>   cmd: ubi: remove redundant initializations
>   cmd: ubi: check 'updating' before calling ubi_more_update_data()
> 
>  cmd/ubi.c | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
>