diff options
Diffstat (limited to 'drivers/net/pppoe.c')
-rw-r--r-- | drivers/net/pppoe.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index e9fb616ff663..f761a9aae4c8 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -207,7 +207,7 @@ static inline struct pppox_sock *get_item(unsigned long sid, | |||
207 | 207 | ||
208 | static inline struct pppox_sock *get_item_by_addr(struct sockaddr_pppox *sp) | 208 | static inline struct pppox_sock *get_item_by_addr(struct sockaddr_pppox *sp) |
209 | { | 209 | { |
210 | struct net_device *dev = NULL; | 210 | struct net_device *dev; |
211 | int ifindex; | 211 | int ifindex; |
212 | 212 | ||
213 | dev = dev_get_by_name(sp->sa_addr.pppoe.dev); | 213 | dev = dev_get_by_name(sp->sa_addr.pppoe.dev); |
@@ -222,9 +222,6 @@ static inline int set_item(struct pppox_sock *po) | |||
222 | { | 222 | { |
223 | int i; | 223 | int i; |
224 | 224 | ||
225 | if (!po) | ||
226 | return -EINVAL; | ||
227 | |||
228 | write_lock_bh(&pppoe_hash_lock); | 225 | write_lock_bh(&pppoe_hash_lock); |
229 | i = __set_item(po); | 226 | i = __set_item(po); |
230 | write_unlock_bh(&pppoe_hash_lock); | 227 | write_unlock_bh(&pppoe_hash_lock); |
@@ -344,7 +341,7 @@ static struct notifier_block pppoe_notifier = { | |||
344 | static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb) | 341 | static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb) |
345 | { | 342 | { |
346 | struct pppox_sock *po = pppox_sk(sk); | 343 | struct pppox_sock *po = pppox_sk(sk); |
347 | struct pppox_sock *relay_po = NULL; | 344 | struct pppox_sock *relay_po; |
348 | 345 | ||
349 | if (sk->sk_state & PPPOX_BOUND) { | 346 | if (sk->sk_state & PPPOX_BOUND) { |
350 | struct pppoe_hdr *ph = pppoe_hdr(skb); | 347 | struct pppoe_hdr *ph = pppoe_hdr(skb); |
@@ -514,7 +511,6 @@ static int pppoe_release(struct socket *sock) | |||
514 | { | 511 | { |
515 | struct sock *sk = sock->sk; | 512 | struct sock *sk = sock->sk; |
516 | struct pppox_sock *po; | 513 | struct pppox_sock *po; |
517 | int error = 0; | ||
518 | 514 | ||
519 | if (!sk) | 515 | if (!sk) |
520 | return 0; | 516 | return 0; |
@@ -543,7 +539,7 @@ static int pppoe_release(struct socket *sock) | |||
543 | skb_queue_purge(&sk->sk_receive_queue); | 539 | skb_queue_purge(&sk->sk_receive_queue); |
544 | sock_put(sk); | 540 | sock_put(sk); |
545 | 541 | ||
546 | return error; | 542 | return 0; |
547 | } | 543 | } |
548 | 544 | ||
549 | 545 | ||
@@ -762,10 +758,10 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd, | |||
762 | static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock, | 758 | static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock, |
763 | struct msghdr *m, size_t total_len) | 759 | struct msghdr *m, size_t total_len) |
764 | { | 760 | { |
765 | struct sk_buff *skb = NULL; | 761 | struct sk_buff *skb; |
766 | struct sock *sk = sock->sk; | 762 | struct sock *sk = sock->sk; |
767 | struct pppox_sock *po = pppox_sk(sk); | 763 | struct pppox_sock *po = pppox_sk(sk); |
768 | int error = 0; | 764 | int error; |
769 | struct pppoe_hdr hdr; | 765 | struct pppoe_hdr hdr; |
770 | struct pppoe_hdr *ph; | 766 | struct pppoe_hdr *ph; |
771 | struct net_device *dev; | 767 | struct net_device *dev; |
@@ -930,7 +926,7 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
930 | struct msghdr *m, size_t total_len, int flags) | 926 | struct msghdr *m, size_t total_len, int flags) |
931 | { | 927 | { |
932 | struct sock *sk = sock->sk; | 928 | struct sock *sk = sock->sk; |
933 | struct sk_buff *skb = NULL; | 929 | struct sk_buff *skb; |
934 | int error = 0; | 930 | int error = 0; |
935 | 931 | ||
936 | if (sk->sk_state & PPPOX_BOUND) { | 932 | if (sk->sk_state & PPPOX_BOUND) { |
@@ -941,9 +937,8 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
941 | skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, | 937 | skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, |
942 | flags & MSG_DONTWAIT, &error); | 938 | flags & MSG_DONTWAIT, &error); |
943 | 939 | ||
944 | if (error < 0) { | 940 | if (error < 0) |
945 | goto end; | 941 | goto end; |
946 | } | ||
947 | 942 | ||
948 | m->msg_namelen = 0; | 943 | m->msg_namelen = 0; |
949 | 944 | ||
@@ -986,7 +981,7 @@ out: | |||
986 | 981 | ||
987 | static __inline__ struct pppox_sock *pppoe_get_idx(loff_t pos) | 982 | static __inline__ struct pppox_sock *pppoe_get_idx(loff_t pos) |
988 | { | 983 | { |
989 | struct pppox_sock *po = NULL; | 984 | struct pppox_sock *po; |
990 | int i = 0; | 985 | int i = 0; |
991 | 986 | ||
992 | for (; i < PPPOE_HASH_SIZE; i++) { | 987 | for (; i < PPPOE_HASH_SIZE; i++) { |