aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/buffer.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-11-13 01:20:59 -0500
committerFelipe Balbi <balbi@ti.com>2014-11-18 09:47:44 -0500
commit0448d38c1e8cd64fb2fa88f44cbc7c3dcf75ed6c (patch)
tree394b9a301440c096215d0ae053943ce7dd1a40c0 /drivers/usb/core/buffer.c
parent828f6148e89ec051c2540400773655c0174ccaa3 (diff)
usb: gadget: f_hid: fix error handling in ghid_setup()
There were a two issues here. 1) We returned PTR_ERR(NULL) which means success if class_create() failed. 2) If alloc_chrdev_region() failed then we should clean up before returning. Also kernel style is to have "error handling" as opposed to "success handling". In the original code checking for "if (!status) " is confusing and this bad style is what lead to bug #2. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/core/buffer.c')
0 files changed, 0 insertions, 0 deletions