Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7d9e8931f93683e575679e41f188d3b465269f08
Commit:     7d9e8931f93683e575679e41f188d3b465269f08
Parent:     cd1f7d347c9e51f348119811bd41b74346ec57b8
Author:     Gerrit Renker <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 4 14:41:26 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:54:34 2007 -0700

    [CCID2]: Remove ugly BUG_ON
    
    This removes an ugly BUG_ON which has been pointed out by Arnaldo.
    
    Instead of freezing up the machine, a `critical' message is now issued
    to the system log.
    
    There is potential of doing this more gracefully (eg. there are a few
    internal variables which could be updated despite the lack of memory),
    but that requires more complicated changes to the algorithm; thus a
    `FIXME' has been added.
    
    Signed-off-by: Gerrit Renker <[EMAIL PROTECTED]>
    Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/dccp/ccids/ccid2.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 5c6b4f9..3e4fa6b 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -294,12 +294,11 @@ static void ccid2_hc_tx_packet_sent(struct sock *sk, int 
more, unsigned int len)
        next = hctx->ccid2hctx_seqh->ccid2s_next;
        /* check if we need to alloc more space */
        if (next == hctx->ccid2hctx_seqt) {
-               int rc;
-
-               ccid2_pr_debug("allocating more space in history\n");
-               rc = ccid2_hc_tx_alloc_seq(hctx);
-               BUG_ON(rc); /* XXX what do we do? */
-
+               if (ccid2_hc_tx_alloc_seq(hctx)) {
+                       DCCP_CRIT("packet history - out of memory!");
+                       /* FIXME: find a more graceful way to bail out */
+                       return;
+               }
                next = hctx->ccid2hctx_seqh->ccid2s_next;
                BUG_ON(next == hctx->ccid2hctx_seqt);
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to