Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c764c9ade6d9b710bad2b9c631ede9864333b98c
Commit:     c764c9ade6d9b710bad2b9c631ede9864333b98c
Parent:     4c1b52bc7a2f5ee01ea3fc248a8748a1c6843f7c
Author:     Akinobu Mita <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 5 12:56:53 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Jun 7 13:40:38 2007 -0700

    [NETFILTER]: nf_conntrack_amanda: fix textsearch_prepare() error check
    
    The return value from textsearch_prepare() needs to be checked
    by IS_ERR(). Because it returns error code as a pointer.
    
    Cc: "Brian J. Murrell" <[EMAIL PROTECTED]>
    Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/netfilter/nf_conntrack_amanda.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/netfilter/nf_conntrack_amanda.c 
b/net/netfilter/nf_conntrack_amanda.c
index b8869ea..0568f2e 100644
--- a/net/netfilter/nf_conntrack_amanda.c
+++ b/net/netfilter/nf_conntrack_amanda.c
@@ -208,13 +208,14 @@ static int __init nf_conntrack_amanda_init(void)
 {
        int ret, i;
 
-       ret = -ENOMEM;
        for (i = 0; i < ARRAY_SIZE(search); i++) {
                search[i].ts = textsearch_prepare(ts_algo, search[i].string,
                                                  search[i].len,
                                                  GFP_KERNEL, TS_AUTOLOAD);
-               if (search[i].ts == NULL)
+               if (IS_ERR(search[i].ts)) {
+                       ret = PTR_ERR(search[i].ts);
                        goto err1;
+               }
        }
        ret = nf_conntrack_helper_register(&amanda_helper[0]);
        if (ret < 0)
@@ -227,10 +228,9 @@ static int __init nf_conntrack_amanda_init(void)
 err2:
        nf_conntrack_helper_unregister(&amanda_helper[0]);
 err1:
-       for (; i >= 0; i--) {
-               if (search[i].ts)
-                       textsearch_destroy(search[i].ts);
-       }
+       while (--i >= 0)
+               textsearch_destroy(search[i].ts);
+
        return ret;
 }
 
-
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