Date: Sun, 23 Apr 2017 07:35:10 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317319 - stable/11/sys/cam/ctl Message-ID: <201704230735.v3N7ZACN045352@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sun Apr 23 07:35:10 2017 New Revision: 317319 URL: https://svnweb.freebsd.org/changeset/base/317319 Log: MFC r316653: Fix few minor issues found by Clang Analyzer. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sun Apr 23 06:45:21 2017 (r317318) +++ stable/11/sys/cam/ctl/ctl.c Sun Apr 23 07:35:10 2017 (r317319) @@ -7047,7 +7047,7 @@ ctl_get_lba_status(struct ctl_scsiio *ct lbalen->len = total_len; lbalen->flags = 0; retval = lun->backend->config_read((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + return (retval); } int Modified: stable/11/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Sun Apr 23 06:45:21 2017 (r317318) +++ stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Sun Apr 23 07:35:10 2017 (r317319) @@ -321,11 +321,10 @@ cfiscsi_pdu_handle(struct icl_pdu *reque static void cfiscsi_receive_callback(struct icl_pdu *request) { +#ifdef ICL_KERNEL_PROXY struct cfiscsi_session *cs; cs = PDU_SESSION(request); - -#ifdef ICL_KERNEL_PROXY if (cs->cs_waiting_for_ctld || cs->cs_login_phase) { if (cs->cs_login_pdu == NULL) cs->cs_login_pdu = request; @@ -1706,6 +1705,13 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) sbuf_finish(sb); error = copyout(sbuf_data(sb), cilp->conn_xml, sbuf_len(sb) + 1); + if (error != 0) { + sbuf_delete(sb); + snprintf(ci->error_str, sizeof(ci->error_str), + "copyout failed with error %d", error); + ci->status = CTL_ISCSI_ERROR; + return; + } cilp->fill_len = sbuf_len(sb) + 1; ci->status = CTL_ISCSI_OK; sbuf_delete(sb); @@ -2158,9 +2164,9 @@ cfiscsi_ioctl_port_create(struct ctl_req retval = ctl_port_register(port); if (retval != 0) { ctl_free_opts(&port->options); - cfiscsi_target_release(ct); free(port->port_devid, M_CFISCSI); free(port->target_devid, M_CFISCSI); + cfiscsi_target_release(ct); req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), "ctl_port_register() failed with error %d", retval);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704230735.v3N7ZACN045352>