Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be85d4ad authored by Urs Thuermann's avatar Urs Thuermann Committed by David S. Miller
Browse files

[AF_PACKET]: Fix minor code duplication



Simplify some code by eliminating duplicate if-else clauses in
packet_do_bind().

Signed-off-by: default avatarUrs Thuermann <urs@isnogud.escape.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 57ce45dd
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -881,8 +881,7 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 protoc
	if (protocol == 0)
		goto out_unlock;

	if (dev) {
		if (dev->flags&IFF_UP) {
	if (!dev || (dev->flags & IFF_UP)) {
		dev_add_pack(&po->prot_hook);
		sock_hold(sk);
		po->running = 1;
@@ -891,11 +890,6 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, __be16 protoc
		if (!sock_flag(sk, SOCK_DEAD))
			sk->sk_error_report(sk);
	}
	} else {
		dev_add_pack(&po->prot_hook);
		sock_hold(sk);
		po->running = 1;
	}

out_unlock:
	spin_unlock(&po->bind_lock);