Skip to content

Commit

Permalink
net/ax25: Use available error codes
Browse files Browse the repository at this point in the history
Error codes are stored in err, but the return value is always 0.  Return
err instead.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
local idexpression x;
constant C;
@@

if (...) { ...
  x = -C
  ... when != x
(
  return <+...x...+>;
|
  return NULL;
|
  return;
|
* return ...;
)
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Julia Lawall authored and David S. Miller committed Aug 18, 2010
1 parent b3d18f1 commit 49339cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ax25/af_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
out:
release_sock(sk);

return 0;
return err;
}

/*
Expand Down

0 comments on commit 49339cc

Please sign in to comment.