aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r--drivers/usb/storage/usb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 92ee079d9172..eb901817b7d2 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -467,6 +467,12 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf)
467 US_DEBUGP("I/O buffer allocation failed\n"); 467 US_DEBUGP("I/O buffer allocation failed\n");
468 return -ENOMEM; 468 return -ENOMEM;
469 } 469 }
470
471 us->sensebuf = kmalloc(US_SENSE_SIZE, GFP_KERNEL);
472 if (!us->sensebuf) {
473 US_DEBUGP("Sense buffer allocation failed\n");
474 return -ENOMEM;
475 }
470 return 0; 476 return 0;
471} 477}
472 478
@@ -800,6 +806,8 @@ static void dissociate_dev(struct us_data *us)
800{ 806{
801 US_DEBUGP("-- %s\n", __FUNCTION__); 807 US_DEBUGP("-- %s\n", __FUNCTION__);
802 808
809 kfree(us->sensebuf);
810
803 /* Free the device-related DMA-mapped buffers */ 811 /* Free the device-related DMA-mapped buffers */
804 if (us->cr) 812 if (us->cr)
805 usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr, 813 usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr,