All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tilman Schmidt <tilman@imap.cc>
To: Chen Gang <gang.chen@asianux.com>
Cc: isdn@linux-pingi.de, Jiri Slaby <jslaby@suse.cz>,
	Jiri Kosina <jkosina@suse.cz>, David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [Suggestion] drivers/isdn/divert: break looping, or memory leak by calling kmalloc again
Date: Mon, 01 Apr 2013 12:08:26 +0200	[thread overview]
Message-ID: <51595C9A.1060608@imap.cc> (raw)
In-Reply-To: <5158ECBD.4050109@asianux.com>

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

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.

HTH
Tilman

-- 
Tilman Schmidt                    E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

  reply	other threads:[~2013-04-01 10:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01  2:11 [Suggestion] drivers/isdn/divert: break looping, or memory leak by calling kmalloc again Chen Gang
2013-04-01 10:08 ` Tilman Schmidt [this message]
2013-04-01 10:19   ` Chen Gang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51595C9A.1060608@imap.cc \
    --to=tilman@imap.cc \
    --cc=davem@davemloft.net \
    --cc=gang.chen@asianux.com \
    --cc=isdn@linux-pingi.de \
    --cc=jkosina@suse.cz \
    --cc=jslaby@suse.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.