Subject: Re: [Suggestion] drivers/isdn/divert: break looping, or memory leak by calling kmalloc again

From: Chen Gang <[email-masked]>
Date: Mon, 01 Apr 2013 18:19:56 +0800

On 2013年04月01日 18:08, Tilman Schmidt wrote:
> Am 01.04.2013 04:11, schrieb Chen Gang:
>> > in drivers/isdn/divert/isdn_divert.c:
>> > 
>> >   in 'for' looping (line 395..515)
>> >     the 'cs' may call kmalloc again (line 453).
>> > 
>> >   it seems need break looping, when get valid 'cs' value (line 509)
> I don't think so. If the kmalloc for cs succeeds, control flow will
> continue linearly up to the 'if' statement in line 503. Then it will
> either kfree(cs) and return, or reach the 'break' in line 514 which
> will end the 'for' loop.

  oh, really it is, it is my fault !
    (I did not see the break at line 514)

  thanks.

  :-)

-- 
Chen Gang

Asianux Corporation