Commit 976942da authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: usb/core/config.c null pointers after kfree

Prevents an oops with some other patchsets.


Clear some pointers after the memory is kfreed, to avoid
making some other patch combinations oops.
parent eea93a30
...@@ -367,6 +367,7 @@ void usb_destroy_configuration(struct usb_device *dev) ...@@ -367,6 +367,7 @@ void usb_destroy_configuration(struct usb_device *dev)
kfree(dev->rawdescriptors[i]); kfree(dev->rawdescriptors[i]);
kfree(dev->rawdescriptors); kfree(dev->rawdescriptors);
dev->rawdescriptors = 0;
} }
for (c = 0; c < dev->descriptor.bNumConfigurations; c++) { for (c = 0; c < dev->descriptor.bNumConfigurations; c++) {
...@@ -380,6 +381,7 @@ void usb_destroy_configuration(struct usb_device *dev) ...@@ -380,6 +381,7 @@ void usb_destroy_configuration(struct usb_device *dev)
} }
} }
kfree(dev->config); kfree(dev->config);
dev->config = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment