Date: Sat, 14 Nov 2015 16:18:22 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290824 - head/usr.sbin/ctld Message-ID: <201511141618.tAEGIMSU065315@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Sat Nov 14 16:18:22 2015 New Revision: 290824 URL: https://svnweb.freebsd.org/changeset/base/290824 Log: Add missing error checks. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Sat Nov 14 16:15:38 2015 (r290823) +++ head/usr.sbin/ctld/kernel.c Sat Nov 14 16:18:22 2015 (r290824) @@ -516,13 +516,19 @@ retry_port: if (strcmp(port->port_frontend, "ha") == 0) continue; free(name); - if (port->pp == 0 && port->vp == 0) + if (port->pp == 0 && port->vp == 0) { name = checked_strdup(port->port_name); - else if (port->vp == 0) - asprintf(&name, "%s/%d", port->port_name, port->pp); - else - asprintf(&name, "%s/%d/%d", port->port_name, port->pp, - port->vp); + } else if (port->vp == 0) { + retval = asprintf(&name, "%s/%d", + port->port_name, port->pp); + if (retval <= 0) + log_err(1, "asprintf"); + } else { + retval = asprintf(&name, "%s/%d/%d", + port->port_name, port->pp, port->vp); + if (retval <= 0) + log_err(1, "asprintf"); + } if (port->cfiscsi_target == NULL) { log_debugx("CTL port %u \"%s\" wasn't managed by ctld; ",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511141618.tAEGIMSU065315>