Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=00f5e06c032507206c4ac0c846ad82b75ae7665b
Commit:     00f5e06c032507206c4ac0c846ad82b75ae7665b
Parent:     fd00eeccd92b7b4b5ca95bd988c195efb4e5ec29
Author:     Li Zefan <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 4 01:55:01 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:00:38 2008 -0800

    [CONNECTOR]: clean up {,__}cn_rx_skb()
    
    - __cn_rx_skb() does nothing but calls cn_call_callback(), it doesn't
    check skb and msg sizes as the comment suggests, but cn_rx_skb() checks
    those sizes.
    
    - In cn_rx_skb() Local variable 'len' is not used. 'len' is probably
    intended to be passed to skb_pull(), but here skb_pull() is not needed,
    instead skb_free() is called.
    
    Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/connector/connector.c |   30 ++++--------------------------
 1 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index edf1349..37976dc 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -182,33 +182,14 @@ static int cn_call_callback(struct cn_msg *msg, void 
(*destruct_data)(void *), v
 }
 
 /*
- * Skb receive helper - checks skb and msg size and calls callback
- * helper.
- */
-static int __cn_rx_skb(struct sk_buff *skb, struct nlmsghdr *nlh)
-{
-       u32 pid, uid, seq, group;
-       struct cn_msg *msg;
-
-       pid = NETLINK_CREDS(skb)->pid;
-       uid = NETLINK_CREDS(skb)->uid;
-       seq = nlh->nlmsg_seq;
-       group = NETLINK_CB((skb)).dst_group;
-       msg = NLMSG_DATA(nlh);
-
-       return cn_call_callback(msg, (void (*)(void *))kfree_skb, skb);
-}
-
-/*
  * Main netlink receiving function.
  *
- * It checks skb and netlink header sizes and calls the skb receive
- * helper with a shared skb.
+ * It checks skb, netlink header and msg sizes, and calls callback helper.
  */
 static void cn_rx_skb(struct sk_buff *__skb)
 {
+       struct cn_msg *msg;
        struct nlmsghdr *nlh;
-       u32 len;
        int err;
        struct sk_buff *skb;
 
@@ -224,11 +205,8 @@ static void cn_rx_skb(struct sk_buff *__skb)
                        return;
                }
 
-               len = NLMSG_ALIGN(nlh->nlmsg_len);
-               if (len > skb->len)
-                       len = skb->len;
-
-               err = __cn_rx_skb(skb, nlh);
+               msg = NLMSG_DATA(nlh);
+               err = cn_call_callback(msg, (void (*)(void *))kfree_skb, skb);
                if (err < 0)
                        kfree_skb(skb);
        }
-
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