Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102936360
D43130.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D43130.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D43130: ses: Add error checking for copyout() calls
Attached
Detach File
Event Timeline
Log In to Comment