summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/debugfs.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-08-26 11:21:13 +0200
committerFelipe Balbi <balbi@ti.com>2011-09-09 12:01:59 +0200
commitb4f28a98ea64b6cb009bb03810e8a8dd08767f46 (patch)
tree8a2754e4611d96efc421fcef3a6b1d7555ea1f60 /drivers/usb/dwc3/debugfs.c
parentusb: dwc3: gaget: clear DWC3_EP_WILL_SHUTDOWN bit (diff)
downloadlinux-b4f28a98ea64b6cb009bb03810e8a8dd08767f46.tar.xz
linux-b4f28a98ea64b6cb009bb03810e8a8dd08767f46.zip
usb: dwc3: debugfs: add a kfree() on error to dwc3_testmode_open()
We may as well fix this potential leak so we don't have to listen to the static checkers complain. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/debugfs.c')
-rw-r--r--drivers/usb/dwc3/debugfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c
index 432df5393720..dd861c499d28 100644
--- a/drivers/usb/dwc3/debugfs.c
+++ b/drivers/usb/dwc3/debugfs.c
@@ -445,8 +445,10 @@ static int dwc3_testmode_open(struct inode *inode, struct file *file)
if (!buf0)
return -ENOMEM;
buf1 = kmalloc(BUF_SIZE, GFP_KERNEL);
- if (!buf1)
+ if (!buf1) {
+ kfree(buf0);
return -ENOMEM;
+ }
memset(buf0, 0xaa, BUF_SIZE);
memset(buf1, 0x33, BUF_SIZE);