Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178154984
D9239.1796138053.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D9239.1796138053.diff
View Options
Index: sbin/camcontrol/camcontrol.8
===================================================================
--- sbin/camcontrol/camcontrol.8
+++ sbin/camcontrol/camcontrol.8
@@ -2374,6 +2374,20 @@
.It state
Enable or disable a particular power condition.
.Bl -tag -width 7n
+.It Fl e
+Enable the power condition.
+One of
+.Fl e
+or
+.Fl d
+is required.
+.It Fl d
+Disable the power condition.
+One of
+.Fl d
+or
+.Fl e
+is required.
.It Fl p Ar cond
Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z.
This argument is required.
Index: sbin/camcontrol/epc.c
===================================================================
--- sbin/camcontrol/epc.c
+++ sbin/camcontrol/epc.c
@@ -783,6 +783,7 @@
warnx("Must specify a timer value (-T time)");
error = 1;
}
+ /* FALLTHROUGH */
case ATA_SF_EPC_SET_STATE:
if (enable == -1) {
warnx("Must specify enable (-e) or disable (-d)");
Index: sbin/camcontrol/persist.c
===================================================================
--- sbin/camcontrol/persist.c
+++ sbin/camcontrol/persist.c
@@ -241,9 +241,11 @@
{
uint32_t length;
int check_type_mask = 0;
+ uint32_t type_mask;
length = scsi_2btoul(cap->length);
length = MIN(length, valid_len);
+ type_mask = scsi_2btoul(cap->type_mask);
if (length < __offsetof(struct scsi_per_res_cap, type_mask)) {
fprintf(stdout, "Insufficient data (%u bytes) to report "
@@ -345,20 +347,20 @@
fprintf(stdout, "Supported Persistent Reservation Types:\n");
fprintf(stdout, " Write Exclusive - All Registrants "
"(WR_EX_AR): %d\n",
- (cap->type_mask[0] & SPRI_TM_WR_EX_AR)? 1 : 0);
+ (type_mask & SPRI_TM_WR_EX_AR)? 1 : 0);
fprintf(stdout, " Exclusive Access - Registrants Only "
"(EX_AC_RO): %d\n",
- (cap->type_mask[0] & SPRI_TM_EX_AC_RO) ? 1 : 0);
+ (type_mask & SPRI_TM_EX_AC_RO) ? 1 : 0);
fprintf(stdout, " Write Exclusive - Registrants Only "
"(WR_EX_RO): %d\n",
- (cap->type_mask[0] & SPRI_TM_WR_EX_RO)? 1 : 0);
+ (type_mask & SPRI_TM_WR_EX_RO)? 1 : 0);
fprintf(stdout, " Exclusive Access (EX_AC): %d\n",
- (cap->type_mask[0] & SPRI_TM_EX_AC) ? 1 : 0);
+ (type_mask & SPRI_TM_EX_AC) ? 1 : 0);
fprintf(stdout, " Write Exclusive (WR_EX): %d\n",
- (cap->type_mask[0] & SPRI_TM_WR_EX) ? 1 : 0);
+ (type_mask & SPRI_TM_WR_EX) ? 1 : 0);
fprintf(stdout, " Exclusive Access - All Registrants "
"(EX_AC_AR): %d\n",
- (cap->type_mask[1] & SPRI_TM_EX_AC_AR) ? 1 : 0);
+ (type_mask & SPRI_TM_EX_AC_AR) ? 1 : 0);
} else {
fprintf(stdout, "Persistent Reservation Type Mask is NOT "
"valid\n");
Index: sbin/camcontrol/timestamp.c
===================================================================
--- sbin/camcontrol/timestamp.c
+++ sbin/camcontrol/timestamp.c
@@ -40,6 +40,7 @@
#include <sys/types.h>
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -138,6 +139,8 @@
* Create the control page at the correct point in the mode_buf, it
* starts after the header and the blk description.
*/
+ assert(hdr_and_blk_length <=
+ sizeof(mode_buf) - sizeof(struct scsi_control_ext_page));
control_page = (struct scsi_control_ext_page *)&mode_buf
[hdr_and_blk_length];
if (set_flag != 0) {
@@ -240,6 +243,7 @@
bailout:
if (ccb != NULL)
cam_freeccb(ccb);
+ free(report_buf);
return error;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 1, 3:14 PM (10 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42126700
Default Alt Text
D9239.1796138053.diff (3 KB)
Attached To
Mode
D9239: Misc Coverity fixes in camcontrol(8)
Attached
Detach File
Event Timeline