Page MenuHomeFreeBSD

D14790.id40578.diff
No OneTemporary

D14790.id40578.diff

Index: sys/dev/jedec_dimm/jedec_dimm.c
===================================================================
--- sys/dev/jedec_dimm/jedec_dimm.c
+++ sys/dev/jedec_dimm/jedec_dimm.c
@@ -192,6 +192,7 @@
int rc;
int new_desc_len;
enum dram_type type;
+ size_t slotid_str_size;
struct jedec_dimm_softc *sc;
struct sysctl_ctx_list *ctx;
struct sysctl_oid *oid;
@@ -338,13 +339,14 @@
}
/* If a "slotid" was hinted, add the sysctl for it. */
+ slotid_str_size = 0;
if (resource_string_value(device_get_name(dev), device_get_unit(dev),
"slotid", &slotid_str) == 0) {
if (slotid_str != NULL) {
- sc->slotid_str = malloc(strlen(slotid_str) + 1,
- M_DEVBUF, (M_WAITOK | M_ZERO));
- strlcpy(sc->slotid_str, slotid_str,
- sizeof(sc->slotid_str));
+ slotid_str_size = strlen(slotid_str) + 1;
+ sc->slotid_str = malloc(slotid_str_size, M_DEVBUF,
+ M_WAITOK);
+ strlcpy(sc->slotid_str, slotid_str, slotid_str_size);
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "slotid",
CTLFLAG_RD | CTLFLAG_MPSAFE, sc->slotid_str, 0,
"DIMM Slot Identifier");

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 17, 6:14 AM (2 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29811484
Default Alt Text
D14790.id40578.diff (1 KB)

Event Timeline