[NET]: skb_trim audit
[linux-2.6.git] / include / net / sock.h
index 75b0e97ed93db8328d5cf1aee4b7e416261011ae..96565ff0de6aa46e08eb932a8a97b4c5da9f3451 100644 (file)
@@ -873,10 +873,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock)
                if (filter) {
                        unsigned int pkt_len = sk_run_filter(skb, filter->insns,
                                                             filter->len);
-                       if (!pkt_len)
-                               err = -EPERM;
-                       else
-                               skb_trim(skb, pkt_len);
+                       err = pkt_len ? pskb_trim(skb, pkt_len) : -EPERM;
                }
 
                if (needlock)