Source-Changes-HG archive

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

[src/trunk]: src/sbin/iscsid Fix 4 more instances of the same bug (not return...



details:   https://anonhg.NetBSD.org/src/rev/094b83143785
branches:  trunk
changeset: 779436:094b83143785
user:      riz <riz%NetBSD.org@localhost>
date:      Mon May 28 00:37:55 2012 +0000

description:
Fix 4 more instances of the same bug (not returning NULL when stuff
not found).  While I'm here, add comments so it hopefully doesn't happen
again.

diffstat:

 sbin/iscsid/iscsid_lists.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (52 lines):

diff -r dd297e0bdd05 -r 094b83143785 sbin/iscsid/iscsid_lists.c
--- a/sbin/iscsid/iscsid_lists.c        Mon May 28 00:13:19 2012 +0000
+++ b/sbin/iscsid/iscsid_lists.c        Mon May 28 00:37:55 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsid_lists.c,v 1.6 2012/05/27 23:54:45 riz Exp $     */
+/*     $NetBSD: iscsid_lists.c,v 1.7 2012/05/28 00:37:55 riz Exp $     */
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -232,8 +232,8 @@
                        break;
        }
 
+       /* return curr instead of t because curr==NULL if name not found */
        DEB(10, ("Find_TargetName returns %p\n", curr));
-
        return (target_t *)curr;
 }
 
@@ -266,8 +266,9 @@
                        break;
        }
 
+       /* return curr instead of p because curr==NULL if not found */
        DEB(10, ("Find_portal_by_addr returns %p\n", curr));
-       return p;
+       return (portal_t *)curr;
 }
 
 
@@ -293,8 +294,9 @@
                        break;
        }
 
+       /* return curr instead of p because curr==NULL if not found */
        DEB(10, ("Find_send_target_by_addr returns %p\n", curr));
-       return t;
+       return (send_target_t *)curr;
 }
 
 
@@ -694,8 +696,9 @@
                        break;
        }
 
+       /* return curr instead of i because if not found, curr==NULL */
        DEB(9, ("Find_initiator_by_addr returns %p\n", curr));
-       return i;
+       return (initiator_t *)curr;
 }
 
 



Home | Main Index | Thread Index | Old Index