linux_dsm_epyc7002/drivers/usb/gadget/function
Dan Carpenter 0448d38c1e 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>
2014-11-18 08:47:44 -06:00
..
f_acm.c usb: gadget: function: acm: make f_acm pass USB20CV Chapter9 2014-10-20 15:58:48 -05:00
f_ecm.c
f_eem.c usb: gadget: function: Remove redundant usb_free_all_descriptors 2014-10-23 13:57:24 -05:00
f_fs.c usb: ffs: fix regression when quirk_ep_out_aligned_size flag is set 2014-10-23 09:55:42 -05:00
f_hid.c usb: gadget: f_hid: fix error handling in ghid_setup() 2014-11-18 08:47:44 -06:00
f_loopback.c usb: gadget: loopback: don't queue requests to bogus endpoints 2014-10-23 09:55:42 -05:00
f_mass_storage.c usb: gadget: f_mass_storage: simplify start_transfer slightly 2014-09-02 09:16:47 -05:00
f_mass_storage.h
f_midi.c usb: gadget: midi: f_midi_alloc() can be static 2014-11-12 09:01:03 -06:00
f_ncm.c usb: gadget: function: Added usb_assign_descriptors failure check 2014-11-03 10:01:24 -06:00
f_obex.c usb: gadget: function: Remove redundant usb_free_all_descriptors 2014-10-23 13:57:24 -05:00
f_phonet.c usb: gadget: function: Remove redundant usb_free_all_descriptors 2014-10-23 13:57:24 -05:00
f_rndis.c usb: gadget: function: Fixed the return value on error path 2014-10-23 14:49:35 -05:00
f_serial.c usb: gadget: serial: replace {V,}DBG macro with dev_{v,}dbg 2014-08-27 14:13:17 -05:00
f_sourcesink.c usb: gadget: zero: Fix warning generated by kbuild 2014-09-09 09:46:58 -05:00
f_subset.c usb: gadget: function: Remove redundant usb_free_all_descriptors 2014-10-23 13:57:24 -05:00
f_uac1.c usb: gadget: f_uac1: add configfs support 2014-08-20 14:05:21 -05:00
f_uac2.c usb: gadget: function: Remove redundant usb_free_all_descriptors 2014-10-23 13:57:24 -05:00
f_uvc.c usb: gadget: function: uvc: disable endpoints on ->disable() 2014-10-20 15:58:48 -05:00
f_uvc.h usb: gadget: f_uvc: remove compatibility layer 2014-09-09 09:49:41 -05:00
g_zero.h usb: gadget: zero: Add support for interrupt EP 2014-08-27 14:13:18 -05:00
Makefile usb: gadget: f_hid: convert to new function interface with backward compatibility 2014-11-06 16:18:18 -06:00
ndis.h
rndis.c
rndis.h
storage_common.c
storage_common.h
u_ecm.h
u_eem.h
u_ether_configfs.h
u_ether.c
u_ether.h
u_fs.h usb: gadget: f_fs: virtual endpoint address mapping 2014-09-16 09:58:21 -05:00
u_gether.h
u_hid.h usb: gadget: hid: add configfs support 2014-11-06 16:18:19 -06:00
u_midi.h usb: gadget: f_midi: add configfs support 2014-11-05 13:37:17 -06:00
u_ncm.h
u_phonet.h
u_rndis.h
u_serial.c usb: gadget: serial: remove PREFIX macro 2014-08-27 14:13:18 -05:00
u_serial.h
u_uac1.c usb: gadget: f_uac1: remove an unneeded NULL check 2014-11-03 10:00:59 -06:00
u_uac1.h usb: gadget: f_uac1: add configfs support 2014-08-20 14:05:21 -05:00
u_uac2.h usb: gadget: f_uac2: add configfs support 2014-08-20 14:04:42 -05:00
u_uvc.h usb: gadget: f_uvc: convert f_uvc to new function interface 2014-09-09 09:49:16 -05:00
uvc_queue.c usb: gadget: uvc: separately compile some components of f_uvc 2014-09-09 09:49:12 -05:00
uvc_queue.h usb: gadget: uvc: separately compile some components of f_uvc 2014-09-09 09:49:12 -05:00
uvc_v4l2.c usb: gadget: uvc: fix up uvcg_v4l2_get_unmapped_area typo 2014-09-29 11:51:54 -04:00
uvc_v4l2.h usb: gadget: uvc: separately compile some components of f_uvc 2014-09-09 09:49:12 -05:00
uvc_video.c usb: gadget: function: uvc: conditionally dequeue 2014-10-20 15:58:48 -05:00
uvc_video.h usb: gadget: uvc: separately compile some components of f_uvc 2014-09-09 09:49:12 -05:00
uvc.h usb: gadget: uvc: separately compile some components of f_uvc 2014-09-09 09:49:12 -05:00