Re: [PATCH] USB: serial: mos7720: improve handling of a kmalloc failure in read_mos_reg()

2021-01-12 Thread Johan Hovold
On Mon, Jan 11, 2021 at 02:09:04PM -0800, t...@redhat.com wrote: > From: Tom Rix > > clang static analysis reports this problem > > mos7720.c:352:2: warning: Undefined or garbage value returned to caller > return d; > ^~~~ > > In the parport_mos7715_read_data()'s call to

Re: [PATCH] USB: serial: mos7720: improve handling of a kmalloc failure in read_mos_reg()

2021-01-11 Thread Nathan Chancellor
On Mon, Jan 11, 2021 at 02:09:04PM -0800, t...@redhat.com wrote: > From: Tom Rix > > clang static analysis reports this problem > > mos7720.c:352:2: warning: Undefined or garbage value returned to caller > return d; > ^~~~ > > In the parport_mos7715_read_data()'s call to

[PATCH] USB: serial: mos7720: improve handling of a kmalloc failure in read_mos_reg()

2021-01-11 Thread trix
From: Tom Rix clang static analysis reports this problem mos7720.c:352:2: warning: Undefined or garbage value returned to caller return d; ^~~~ In the parport_mos7715_read_data()'s call to read_mos_reg(), 'd' is only set after the alloc block. buf = kmalloc(1,