Compare the *number* of patterns to zero, not the pointer to the patterns.
authorPeter Avalos <pavalos@dragonflybsd.org>
Wed, 28 Nov 2007 21:05:00 +0000 (21:05 +0000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Wed, 28 Nov 2007 21:05:00 +0000 (21:05 +0000)
Obtained-from: FreeBSD

sys/bus/cam/cam_xpt.c

index 2e94ed2..025ab89 100644 (file)
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/cam_xpt.c,v 1.80.2.18 2002/12/09 17:31:55 gibbs Exp $
- * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.43 2007/11/24 19:19:43 pavalos Exp $
+ * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.44 2007/11/28 21:05:00 pavalos Exp $
  */
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1831,7 +1831,7 @@ xptdevicematch(struct dev_match_pattern *patterns, u_int num_patterns,
         * If there are no match entries, then this device matches no
         * matter what.
         */
-       if ((patterns == NULL) || (patterns == 0))
+       if ((patterns == NULL) || (num_patterns == 0))
                return(DM_RET_DESCEND | DM_RET_COPY);
 
        for (i = 0; i < num_patterns; i++) {