From b8c3342a325fccdf812dc8edaff0a04730993b25 Mon Sep 17 00:00:00 2001 From: zbb Date: Fri, 27 Nov 2015 18:16:10 +0000 Subject: [PATCH] Do not zero memory in umass_detach The detach function is called very often, for example from get_capacity function. We don't want to loose any pointers here, so disable detaching for umass driver. Submitted by: Wojciech Macek Obtained from: Semihalf Sponsored by: Juniper Networks Inc. Differential Revision: https://reviews.freebsd.org/D4141 --- sys/boot/usb/storage/umass_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/boot/usb/storage/umass_common.c b/sys/boot/usb/storage/umass_common.c index b9c7e0d37a13..5ddd159297b7 100644 --- a/sys/boot/usb/storage/umass_common.c +++ b/sys/boot/usb/storage/umass_common.c @@ -82,6 +82,9 @@ umass_attach(device_t dev) static int umass_detach(device_t dev) { + +#ifdef USB_DEBUG memset(&umass_uaa, 0, sizeof(umass_uaa)); +#endif return (0); }