diff options
| author | Ravi Pokala <rpokala@FreeBSD.org> | 2018-03-22 06:31:05 +0000 |
|---|---|---|
| committer | Ravi Pokala <rpokala@FreeBSD.org> | 2018-03-22 06:31:05 +0000 |
| commit | 4754f6ad4120dbae31229dac9f1d401ae35706dd (patch) | |
| tree | df502ecd860e16d1b2ef2e5a0d766f1ebf937a16 /sys/dev/jedec_dimm | |
| parent | 27cd06b391bb7ec4ace71e26153d8633e4610a20 (diff) | |
Notes
Diffstat (limited to 'sys/dev/jedec_dimm')
| -rw-r--r-- | sys/dev/jedec_dimm/jedec_dimm.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/dev/jedec_dimm/jedec_dimm.c b/sys/dev/jedec_dimm/jedec_dimm.c index c496742f4116..782a662bcd77 100644 --- a/sys/dev/jedec_dimm/jedec_dimm.c +++ b/sys/dev/jedec_dimm/jedec_dimm.c @@ -341,10 +341,7 @@ jedec_dimm_attach(device_t dev) 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)); + sc->slotid_str = strdup(slotid_str, M_DEVBUF); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "slotid", CTLFLAG_RD | CTLFLAG_MPSAFE, sc->slotid_str, 0, "DIMM Slot Identifier"); |
