Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167222942
D58817.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
D58817.diff
View Options
diff --git a/sys/dev/ufshci/ufshci_sim.c b/sys/dev/ufshci/ufshci_sim.c
--- a/sys/dev/ufshci/ufshci_sim.c
+++ b/sys/dev/ufshci/ufshci_sim.c
@@ -144,6 +144,17 @@
payload_len = csio->dxfer_len;
is_write = csio->ccb_h.flags & CAM_DIR_OUT;
+ if (csio->ccb_h.flags & CAM_CDB_POINTER)
+ cdb = csio->cdb_io.cdb_ptr;
+ else
+ cdb = csio->cdb_io.cdb_bytes;
+
+ if (cdb == NULL || csio->cdb_len > sizeof(upiu->cdb)) {
+ ccb->ccb_h.status = CAM_REQ_INVALID;
+ xpt_done(ccb);
+ return;
+ }
+
/* TODO: Check other data type */
if ((csio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_BIO)
req = ufshci_allocate_request_bio((struct bio *)payload,
@@ -184,17 +195,6 @@
upiu->expected_data_transfer_length = htobe32(payload_len);
- if (csio->ccb_h.flags & CAM_CDB_POINTER)
- cdb = csio->cdb_io.cdb_ptr;
- else
- cdb = csio->cdb_io.cdb_bytes;
-
- if (cdb == NULL || csio->cdb_len > sizeof(upiu->cdb)) {
- ccb->ccb_h.status = CAM_REQ_INVALID;
- ufshci_free_request(req);
- xpt_done(ccb);
- return;
- }
memcpy(upiu->cdb, cdb, csio->cdb_len);
ccb->ccb_h.status |= CAM_SIM_QUEUED;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 21, 2:08 AM (13 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36714029
Default Alt Text
D58817.diff (1 KB)
Attached To
Mode
D58817: ufshci: validate the CDB before allocating a request
Attached
Detach File
Event Timeline
Log In to Comment