* [PATCH] net: x25: remove null checks on arrays calling_ae and called_ae
@ 2016-09-08 7:42 Colin King
2016-09-10 1:15 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-09-08 7:42 UTC (permalink / raw)
To: Andrew Hendry, David S . Miller, linux-x25, netdev; +Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
dtefacs.calling_ae and called_ae are both 20 element __u8 arrays and
cannot be null and hence are redundant checks. Remove these.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
net/x25/af_x25.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index a750f33..f83b74d 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1500,12 +1500,8 @@ out_fac_release:
goto out_dtefac_release;
if (dtefacs.calling_len > X25_MAX_AE_LEN)
goto out_dtefac_release;
- if (dtefacs.calling_ae == NULL)
- goto out_dtefac_release;
if (dtefacs.called_len > X25_MAX_AE_LEN)
goto out_dtefac_release;
- if (dtefacs.called_ae == NULL)
- goto out_dtefac_release;
x25->dte_facilities = dtefacs;
rc = 0;
out_dtefac_release:
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: x25: remove null checks on arrays calling_ae and called_ae
2016-09-08 7:42 [PATCH] net: x25: remove null checks on arrays calling_ae and called_ae Colin King
@ 2016-09-10 1:15 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-09-10 1:15 UTC (permalink / raw)
To: colin.king; +Cc: andrew.hendry, linux-x25, netdev, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Thu, 8 Sep 2016 08:42:06 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> dtefacs.calling_ae and called_ae are both 20 element __u8 arrays and
> cannot be null and hence are redundant checks. Remove these.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Indeed, and if they were pointers they would be in userspace and would
need proper uaccess handling.
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-10 1:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-08 7:42 [PATCH] net: x25: remove null checks on arrays calling_ae and called_ae Colin King
2016-09-10 1:15 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).