USB: memory leak in iowarrior.c

this is a classical memory leak in the ioctl handler. The buffer is simply
never freed. This fixes it the obvious way.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Oliver Neukum and committed by Greg Kroah-Hartman fc0f8fc9 944dc184

+4 -3
+4 -3
drivers/usb/misc/iowarrior.c
··· 495 496 /* verify that the device wasn't unplugged */ 497 if (!dev->present) { 498 - mutex_unlock(&dev->mutex); 499 - return -ENODEV; 500 } 501 502 dbg("%s - minor %d, cmd 0x%.4x, arg %ld", __func__, dev->minor, cmd, ··· 579 retval = -ENOTTY; 580 break; 581 } 582 - 583 /* unlock the device */ 584 mutex_unlock(&dev->mutex); 585 return retval; 586 } 587
··· 495 496 /* verify that the device wasn't unplugged */ 497 if (!dev->present) { 498 + retval = -ENODEV; 499 + goto error_out; 500 } 501 502 dbg("%s - minor %d, cmd 0x%.4x, arg %ld", __func__, dev->minor, cmd, ··· 579 retval = -ENOTTY; 580 break; 581 } 582 + error_out: 583 /* unlock the device */ 584 mutex_unlock(&dev->mutex); 585 + kfree(buffer); 586 return retval; 587 } 588