From 84d8bf623b06793e23ac562d7c7ddd94eb56c6f6 Mon Sep 17 00:00:00 2001 From: trasz Date: Wed, 18 Sep 2013 21:15:21 +0000 Subject: Fix several problems in the new iSCSI stack; this includes interoperability fix for LIO (Linux target), removing possibility for the target to avoid mutual CHAP by choosing to skip authentication altogether, and fixing truncated error messages in iscsictl(8) output. This also fixes several of the problems found with Coverity. Note that this change requires world rebuild. Coverity CID: 1088038, 1087998, 1087990, 1088004, 1088044, 1088041, 1088040 Approved by: re (blanket) Sponsored by: FreeBSD Foundation --- usr.sbin/ctld/ctld.c | 10 ++++------ usr.sbin/ctld/kernel.c | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'usr.sbin/ctld') diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index 34fd650..a5472ab 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -348,12 +348,10 @@ portal_group_new(struct conf *conf, const char *name) { struct portal_group *pg; - if (name != NULL) { - pg = portal_group_find(conf, name); - if (pg != NULL) { - log_warnx("duplicated portal-group \"%s\"", name); - return (NULL); - } + pg = portal_group_find(conf, name); + if (pg != NULL) { + log_warnx("duplicated portal-group \"%s\"", name); + return (NULL); } pg = calloc(1, sizeof(*pg)); diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c index 869d0a0..0e00204 100644 --- a/usr.sbin/ctld/kernel.c +++ b/usr.sbin/ctld/kernel.c @@ -628,7 +628,7 @@ kernel_port_on(void) struct ctl_port_entry entry; int error; - bzero(&entry, sizeof(&entry)); + bzero(&entry, sizeof(entry)); entry.port_type = CTL_PORT_ISCSI; entry.targ_port = -1; @@ -648,7 +648,7 @@ kernel_port_off(void) struct ctl_port_entry entry; int error; - bzero(&entry, sizeof(&entry)); + bzero(&entry, sizeof(entry)); entry.port_type = CTL_PORT_ISCSI; entry.targ_port = -1; -- cgit v1.1