aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/iowarrior.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/iowarrior.c')
-rw-r--r--drivers/usb/misc/iowarrior.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index fc51207b71b..3bb33f7bfa3 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -495,8 +495,8 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
495 495
496 /* verify that the device wasn't unplugged */ 496 /* verify that the device wasn't unplugged */
497 if (!dev->present) { 497 if (!dev->present) {
498 mutex_unlock(&dev->mutex); 498 retval = -ENODEV;
499 return -ENODEV; 499 goto error_out;
500 } 500 }
501 501
502 dbg("%s - minor %d, cmd 0x%.4x, arg %ld", __func__, dev->minor, cmd, 502 dbg("%s - minor %d, cmd 0x%.4x, arg %ld", __func__, dev->minor, cmd,
@@ -579,9 +579,10 @@ static int iowarrior_ioctl(struct inode *inode, struct file *file,
579 retval = -ENOTTY; 579 retval = -ENOTTY;
580 break; 580 break;
581 } 581 }
582 582error_out:
583 /* unlock the device */ 583 /* unlock the device */
584 mutex_unlock(&dev->mutex); 584 mutex_unlock(&dev->mutex);
585 kfree(buffer);
585 return retval; 586 return retval;
586} 587}
587 588