Skip to content

Commit 9b37ee7

Browse files
ralfbaechledavem330
authored andcommitted
[NETROM/AX.25/ROSE]: Remove useless tests
Remove error tests that have already been performed by the caller. Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6ddcf62 commit 9b37ee7

3 files changed

Lines changed: 3 additions & 11 deletions

File tree

‎net/ax25/af_ax25.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,11 +1700,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
17001700
}
17011701

17021702
case SIOCGSTAMP:
1703-
if (sk != NULL) {
1704-
res = sock_get_timestamp(sk, argp);
1705-
break;
1706-
}
1707-
res = -EINVAL;
1703+
res = sock_get_timestamp(sk, argp);
17081704
break;
17091705

17101706
case SIOCAX25ADDUID: /* Add a uid to the uid/call map table */

‎net/netrom/af_netrom.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,9 +1187,7 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
11871187
}
11881188

11891189
case SIOCGSTAMP:
1190-
ret = -EINVAL;
1191-
if (sk != NULL)
1192-
ret = sock_get_timestamp(sk, argp);
1190+
ret = sock_get_timestamp(sk, argp);
11931191
release_sock(sk);
11941192
return ret;
11951193

‎net/rose/af_rose.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,9 +1256,7 @@ static int rose_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
12561256
}
12571257

12581258
case SIOCGSTAMP:
1259-
if (sk != NULL)
1260-
return sock_get_timestamp(sk, (struct timeval __user *)argp);
1261-
return -EINVAL;
1259+
return sock_get_timestamp(sk, (struct timeval __user *)argp);
12621260

12631261
case SIOCGIFADDR:
12641262
case SIOCSIFADDR:

0 commit comments

Comments
 (0)