Memory leaks in blkdev when blkdev device is detached
Review Request #2460 — Created Nov. 21, 2019 and submitted
Information | |
---|---|
pwinder | |
illumos-gate | |
Reviewers | |
general | |
Detaching a blkdev from its parents causes a couple of memory leaks.
See bug 12009
Testing is detailed in bug 12009.
But, simply, a blkdev device was detached from an nvme driver and ::findleaks was used to confirm the memory leaks had gone.
-
-
usr/src/uts/common/io/blkdev/blkdev.c (Diff revision 1) So I don't think we should use strlcpy down here. strlcpy() does an implicit strlen(src) as part of its return value. However, we know it's not safe to do a strlen(src) in cases due to the fact that we've been given an explicit bound for 'str' in len. I suspect we should just bcopy km_len bytes and then explicitly set a terminator.