Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern remove unnecessary check that nam != NULL before de...



details:   https://anonhg.NetBSD.org/src/rev/20b561119115
branches:  trunk
changeset: 808039:20b561119115
user:      rtr <rtr%NetBSD.org@localhost>
date:      Sat May 02 21:15:33 2015 +0000

description:
remove unnecessary check that nam != NULL before deref in soconnect()
(added in previous commit).

sockargs copyin() makes sure we don't get NULL here

diffstat:

 sys/kern/uipc_socket.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 310e2ded7f56 -r 20b561119115 sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c    Sat May 02 20:22:12 2015 +0000
+++ b/sys/kern/uipc_socket.c    Sat May 02 21:15:33 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket.c,v 1.241 2015/05/02 20:10:26 rtr Exp $    */
+/*     $NetBSD: uipc_socket.c,v 1.242 2015/05/02 21:15:33 rtr Exp $    */
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.241 2015/05/02 20:10:26 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.242 2015/05/02 21:15:33 rtr Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_sock_counters.h"
@@ -830,8 +830,7 @@
            (error = sodisconnect(so)))) {
                error = EISCONN;
        } else {
-               if (NULL != nam &&
-                   nam->sa_family != so->so_proto->pr_domain->dom_family) {
+               if (nam->sa_family != so->so_proto->pr_domain->dom_family) {
                        return EAFNOSUPPORT;
                }
                error = (*so->so_proto->pr_usrreqs->pr_connect)(so, nam, l);



Home | Main Index | Thread Index | Old Index