RE: [patch] rapidio: dereferencing an error pointer

2016-08-04 Thread Bounine, Alexandre
On Thu, August 04, 2016 1:26 AM Dan Carpenter wrote: > Subject: [patch] rapidio: dereferencing an error pointer > > If riocm_ch_alloc() fails then we end up dereferencing the error > pointer. > Probably simply setting "new_ch = NULL" on the error path would fix t

[patch] rapidio: dereferencing an error pointer

2016-08-03 Thread Dan Carpenter
If riocm_ch_alloc() fails then we end up dereferencing the error pointer. The problem is that we're not unwinding in the reverse order from how we allocate things so it gets confusing. I've changed this around so now "ch" is NULL when we are done with it after we call riocm_put_channel(). That w