Page MenuHomeFreeBSD

D43130.diff
No OneTemporary

D43130.diff

diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c
--- a/sys/cam/scsi/scsi_enc_ses.c
+++ b/sys/cam/scsi/scsi_enc_ses.c
@@ -2810,8 +2810,8 @@
}
if (elmd->elm_desc_len > elmpriv->descr_len)
elmd->elm_desc_len = elmpriv->descr_len;
- copyout(elmpriv->descr, elmd->elm_desc_str, elmd->elm_desc_len);
- return (0);
+ return (copyout(elmpriv->descr, elmd->elm_desc_str,
+ elmd->elm_desc_len));
}
/**
@@ -2827,7 +2827,7 @@
ses_get_elm_devnames(enc_softc_t *enc, encioc_elm_devnames_t *elmdn)
{
struct sbuf sb;
- int len;
+ int error, len;
len = elmdn->elm_names_size;
if (len < 0)
@@ -2839,10 +2839,13 @@
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);
+ error = copyout(sbuf_data(&sb), elmdn->elm_devnames,
+ elmdn->elm_names_len + 1);
sbuf_delete(&sb);
cam_periph_lock(enc->periph);
- return (elmdn->elm_names_len > 0 ? 0 : ENODEV);
+ if (error == 0 && elmdn->elm_names_len == 0)
+ error = ENODEV;
+ return (error);
}
/**
@@ -2921,9 +2924,9 @@
size = rsize;
if (size > sstr->bufsiz)
size = sstr->bufsiz;
- copyout(str, sstr->buf, size);
+ ret = copyout(str, sstr->buf, size);
sstr->bufsiz = rsize;
- return (size == rsize ? 0 : ENOMEM);
+ return (ret != 0 ? ret : (size == rsize ? 0 : ENOMEM));
case ENCIOC_GETENCID:
if (ses_cache->ses_nsubencs < 1)
return (ENODEV);
@@ -2935,9 +2938,9 @@
size = rsize;
if (size > sstr->bufsiz)
size = sstr->bufsiz;
- copyout(str, sstr->buf, size);
+ ret = copyout(str, sstr->buf, size);
sstr->bufsiz = rsize;
- return (size == rsize ? 0 : ENOMEM);
+ return (ret != 0 ? ret : (size == rsize ? 0 : ENOMEM));
default:
return (EINVAL);
}

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 11:32 PM (21 h, 33 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14725325
Default Alt Text
D43130.diff (1 KB)

Event Timeline