]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] USB: usb/core/config.c null pointers after kfree
authorDavid Brownell <david-b@pacbell.net>
Tue, 30 Mar 2004 00:55:23 +0000 (16:55 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 30 Mar 2004 00:55:23 +0000 (16:55 -0800)
Prevents an oops with some other patchsets.

Clear some pointers after the memory is kfreed, to avoid
making some other patch combinations oops.

drivers/usb/core/config.c

index 45beca0b98d95e5dd78846497ab82dbd998668d8..5f24e9ce170dd70391ffadfa3bbf423c9039239a 100644 (file)
@@ -367,6 +367,7 @@ void usb_destroy_configuration(struct usb_device *dev)
                        kfree(dev->rawdescriptors[i]);
 
                kfree(dev->rawdescriptors);
+               dev->rawdescriptors = 0;
        }
 
        for (c = 0; c < dev->descriptor.bNumConfigurations; c++) {
@@ -380,6 +381,7 @@ void usb_destroy_configuration(struct usb_device *dev)
                }
        }
        kfree(dev->config);
+       dev->config = 0;
 }