Trivially avoid a null pointer dereference when drivers
don't set the rman description. While drivers should set it, a kernel panic is not the right behaviour when faced without one.
This commit is contained in:
parent
5e21b51b37
commit
2e0ce59f94
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184173
@ -866,7 +866,8 @@ sysctl_rman(SYSCTL_HANDLER_ARGS)
|
||||
if (res_idx == -1) {
|
||||
bzero(&urm, sizeof(urm));
|
||||
urm.rm_handle = (uintptr_t)rm;
|
||||
strlcpy(urm.rm_descr, rm->rm_descr, RM_TEXTLEN);
|
||||
if (rm->rm_descr != NULL)
|
||||
strlcpy(urm.rm_descr, rm->rm_descr, RM_TEXTLEN);
|
||||
urm.rm_start = rm->rm_start;
|
||||
urm.rm_size = rm->rm_end - rm->rm_start + 1;
|
||||
urm.rm_type = rm->rm_type;
|
||||
|
Loading…
Reference in New Issue
Block a user