Date: Wed, 26 Oct 2016 07:45:15 +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: r307956 - stable/11/sys/cam/scsi Message-ID: <201610260745.u9Q7jFCd010043@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Wed Oct 26 07:45:15 2016 New Revision: 307956 URL: https://svnweb.freebsd.org/changeset/base/307956 Log: MFC r307132: Use copyout() instead of pointing sbuf to user-space buffer. Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_ses.c Wed Oct 26 05:26:59 2016 (r307955) +++ stable/11/sys/cam/scsi/scsi_enc_ses.c Wed Oct 26 07:45:15 2016 (r307956) @@ -2672,13 +2672,13 @@ ses_get_elm_devnames(enc_softc_t *enc, e if (len < 0) return (EINVAL); - sbuf_new(&sb, elmdn->elm_devnames, len, 0); - cam_periph_unlock(enc->periph); + sbuf_new(&sb, NULL, len, SBUF_FIXEDLEN); ses_paths_iter(enc, &enc->enc_cache.elm_map[elmdn->elm_idx], ses_elmdevname_callback, &sb); sbuf_finish(&sb); elmdn->elm_names_len = sbuf_len(&sb); + copyout(sbuf_data(&sb), elmdn->elm_devnames, elmdn->elm_names_len + 1); cam_periph_lock(enc->periph); return (elmdn->elm_names_len > 0 ? 0 : ENODEV); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610260745.u9Q7jFCd010043>