Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144592300
D38739.1775626561.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
899 B
Referenced Files
None
Subscribers
None
D38739.1775626561.diff
View Options
diff --git a/usr.sbin/mpsutil/mps_cmd.c b/usr.sbin/mpsutil/mps_cmd.c
--- a/usr.sbin/mpsutil/mps_cmd.c
+++ b/usr.sbin/mpsutil/mps_cmd.c
@@ -728,20 +728,14 @@
{
MPI2_IOC_FACTS_REPLY *facts;
MPI2_IOC_FACTS_REQUEST req;
- char msgver[8], sysctlname[128];
- size_t len, factslen;
+ size_t factslen;
int error;
- snprintf(sysctlname, sizeof(sysctlname), "dev.%s.%d.msg_version",
- is_mps ? "mps" : "mpr", mps_unit);
-
- factslen = sizeof(MPI2_IOC_FACTS_REPLY);
- len = sizeof(msgver);
- error = sysctlbyname(sysctlname, msgver, &len, NULL, 0);
- if (error == 0) {
- if (strncmp(msgver, "2.6", sizeof(msgver)) == 0)
- factslen += 4;
- }
+ /*
+ * Depending on firmware version, the card may or may not return an
+ * extra 4 bytes. Allocate enough storage for any firmware version.
+ */
+ factslen = sizeof(MPI2_IOC_FACTS_REPLY) + 4;
facts = malloc(factslen);
if (facts == NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 5:36 AM (7 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28298056
Default Alt Text
D38739.1775626561.diff (899 B)
Attached To
Mode
D38739: mprutil: "fix user reply buffer (64)..." warnings
Attached
Detach File
Event Timeline
Log In to Comment