[PATCH V2 2/2] usb: gadget: storage: Remove reference counting

2018-07-03 Thread Jaejoong Kim
The kref used to be needed because sharing of fsg_common among multiple USB function instances was handled by fsg. Now this is managed by configfs, we don't need it anymore. So let's eliminate kref from this driver. Signed-off-by: Jaejoong Kim --- Changes in V2: - Rewrite commit title

[PATCH V2 1/2] usb: gadget: storage: Add error handling for no memory

2018-07-03 Thread Jaejoong Kim
fsg_common_set_num_buffers() may fail due to ENOMEM. So add error handling for fail case. Acked-by: Alan Stern Acked-by: Michal Nazarewicz Signed-off-by: Jaejoong Kim --- Changes in V2: Add Acked-by drivers/usb/gadget/function/f_mass_storage.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH V2 0/2] usb: gadget: storage: remove kref and add error handling

2018-07-03 Thread Jaejoong Kim
Hi This series remove the reference counting and add error handling. Changes in V2: - patch #1. Add Ack-by - patch #2. Remove kref suggested by Alan and Michal Update commit message. Jaejoong Kim (2): usb: gadget: storage: Add error handling for no memory usb: gadget: storage

[PATCH] usb: cdc-acm: Decrement tty port's refcount if probe() fail

2018-06-21 Thread Jaejoong Kim
is not called if the probe() fails, because tty_port's refcount is not zero. So, add tty_port_put() when probe() fails. Signed-off-by: Jaejoong Kim --- drivers/usb/class/cdc-acm.c | 35 +-- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/usb/class

Re: [PATCH 3/3] usb: gadget: storage: Remove EXPORT_SYMBOL_GPL for kref_{put, get}

2018-06-14 Thread Jaejoong Kim
2018년 6월 15일 (금) 오전 3:14, Sergei Shtylyov 님이 작성: > > Hello! > > On 06/14/2018 12:23 PM, Jaejoong Kim wrote: > > > Removing EXPORT_SYMBOL_GPL from kref_{put, get} since it is used > >I thought you removed the exports from the real kref_{get|put}(). :-) > Your

Re: [PATCH 3/3] usb: gadget: storage: Remove EXPORT_SYMBOL_GPL for kref_{put, get}

2018-06-14 Thread Jaejoong Kim
Thanks for the review it. 2018년 6월 14일 (목) 오후 11:48, Alan Stern 님이 작성: > > On Thu, 14 Jun 2018, Jaejoong Kim wrote: > > > Removing EXPORT_SYMBOL_GPL from kref_{put, get} since it is used > > only in f_mass_storage > > > > Signed-off-by: Jaejoong Kim > > Th

[PATCH] doc: usb: Fix typo in gadget_configfs documentation

2018-06-14 Thread Jaejoong Kim
Fix the directory name from 'configfs' to 'configs'. Signed-off-by: Jaejoong Kim --- Documentation/usb/gadget_configfs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/usb/gadget_configfs.txt b/Documentation/usb/gadget_configfs.txt index 635e574..b8cb38a

[PATCH 3/3] usb: gadget: storage: Remove EXPORT_SYMBOL_GPL for kref_{put, get}

2018-06-14 Thread Jaejoong Kim
Removing EXPORT_SYMBOL_GPL from kref_{put, get} since it is used only in f_mass_storage Signed-off-by: Jaejoong Kim --- drivers/usb/gadget/function/f_mass_storage.c | 6 ++ drivers/usb/gadget/function/f_mass_storage.h | 4 2 files changed, 2 insertions(+), 8 deletions(-) diff --git

[PATCH 0/3] usb: gadget: storage: fixes and remove export_symbol

2018-06-14 Thread Jaejoong Kim
Hi, This series fix a reference count for fail case, adds a error handling with ENOMEM and also remove EXPORT_SYMBOL_GLP for kref_{put, get}. Thanks, jaejoong Jaejoong Kim (3): usb: gadget: storage: Fix reference count if fsg_alloc_inst() failed usb: gadget: storage: Add error handling

[PATCH 2/3] usb: gadget: storage: Add error handling for no memory

2018-06-14 Thread Jaejoong Kim
fsg_common_set_num_buffers() may fail due to ENOMEM. So add error handling for fail case. Signed-off-by: Jaejoong Kim --- drivers/usb/gadget/function/f_mass_storage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers

[PATCH 1/3] usb: gadget: storage: Fix reference count if fsg_alloc_inst() failed

2018-06-14 Thread Jaejoong Kim
The reference count is initialized in fsg_alloc_inst(). So if fsg_alloc_inst() fails, we need to add kref_put() to free an allocated memory. Signed-off-by: Jaejoong Kim --- drivers/usb/gadget/function/f_mass_storage.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget

Re: [PATCH 1/2] usb: gadget: udc: Use scnprintf() instead of snprintf()

2018-02-26 Thread Jaejoong Kim
This is one patch file not series. Sorry for the patch numbering mistake. Thanks jaejoong 2018-02-27 11:04 GMT+09:00 Jaejoong Kim <climbbb@gmail.com>: > The show() method should use scnprintf() not snprintf() because snprintf() > may returns a value that exceeds its sec

[PATCH 1/2] usb: gadget: udc: Use scnprintf() instead of snprintf()

2018-02-26 Thread Jaejoong Kim
The show() method should use scnprintf() not snprintf() because snprintf() may returns a value that exceeds its second argument. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- drivers/usb/gadget/udc/core.c | 4 ++-- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- 2 files chan

Re: [PATCH v2] usb: ehci-omap: don't complain on -EPROBE_DEFER when no PHY found

2018-01-17 Thread Jaejoong Kim
In you commit message, there is a typo "when when" 2018-01-17 22:41 GMT+09:00 Roger Quadros : > On 17/01/18 12:08, Ladislav Michl wrote: >> Don't complain on -EPROBE_DEFER when when no PHY found, the driver

Re: Mixer regression with usb soundcard

2017-12-18 Thread Jaejoong Kim
2017-12-19 7:48 GMT+09:00 Takashi Iwai <ti...@suse.de>: > On Mon, 18 Dec 2017 22:56:07 +0100, > Mauro Santos wrote: >> >> On 18-12-2017 19:30, Takashi Iwai wrote: >> > On Mon, 18 Dec 2017 20:10:44 +0100, >> > Mauro Santos wrote: >> >> >&

Re: Mixer regression with usb soundcard

2017-12-18 Thread Jaejoong Kim
l_name(kctl, " Playback Source"); } - usb_audio_dbg(state->chip, "[%d] SU [%s] items = %d\n", + usb_audio_err(state->chip, "[%d] SU [%s] items = %d\n", cval->head.id, kctl->id.name, desc->bNrInPins); return snd_usb_mixer_add_control(>head,

Re: Mixer regression with usb soundcard

2017-12-18 Thread Jaejoong Kim
2017-12-19 2:13 GMT+09:00 Takashi Iwai : > On Mon, 18 Dec 2017 18:05:18 +0100, > Mauro Santos wrote: >> >> On 18-12-2017 15:45, Takashi Iwai wrote: >> > On Mon, 18 Dec 2017 16:30:13 +0100, >> > Mauro Santos wrote: >> >> >> >> On 18-12-2017 13:53, Takashi Iwai wrote: >> >>> On Mon,

Re: Mixer regression with usb soundcard

2017-12-18 Thread Jaejoong Kim
Mauro, thanks for the report and sorry for the make problem. Could you try below debug patch? I add more debug code with Takashi's guideline. diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 84b9f9c..0233425 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -595,7 +595,7 @@ int

Re: NULL pointer dereference in usb_ifnum_to_if

2017-11-09 Thread Jaejoong Kim
Hi, 2017-11-09 3:40 GMT+09:00 Alan Stern : > On Wed, 8 Nov 2017, Philipp Kern wrote: > >> > If the bad access occurred because the uvc driver tried to access a >> > device that had been removed 5 seconds earlier, the most likely >> > explanation is a reference-counting

[PATCH 2/3] usb: gadget: udc: gr: remove duplicate & operation

2017-10-20 Thread Jaejoong Kim
usb_endpoint_maxp() has an inline keyword and searches for bits[10:0] by & operation with 0x7ff. So, we can remove the duplicate & operation with 0x7ff. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- drivers/usb/gadget/udc/gr_udc.c | 2 +- 1 file changed, 1 insertion(

[PATCH 3/3] usb: misc: usbtest: remove duplicate & operation

2017-10-20 Thread Jaejoong Kim
usb_endpoint_maxp() has an inline keyword and searches for bits[10:0] by & operation with 0x7ff. So, we can remove the duplicate & operation with 0x7ff. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- drivers/usb/misc/usbtest.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH 1/3] usb: gadget: udc: remove duplicate & operation

2017-10-20 Thread Jaejoong Kim
usb_endpoint_maxp() has an inline keyword and searches for bits[10:0] by & operation with 0x7ff. So, we can remove the duplicate & operation with 0x7ff. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- drivers/usb/gadget/udc/core.c | 2 +- 1 file changed, 1 insertion(

[PATCH 0/3] usb: remove duplicate & operation

2017-10-20 Thread Jaejoong Kim
usb_endpoint_maxp() has an inline keyword and searches for bits[10:0] by & operation with 0x7ff. So, we can remove the duplicate & operation with 0x7ff. Jaejoong Kim (3): usb: gadget: udc: remove duplicate & operation usb: gadget: udc: gr: remove duplicate & operation us

Re: [PATCH v2] HID: usbhid: fix out-of-bounds bug

2017-10-10 Thread Jaejoong Kim
Hi, To. Jiri, Alan, Could you please review this patch? To. Andey, Could you please test with this patch for KASAN OOB error? Thanks, jaejoong 2017-09-28 19:16 GMT+09:00 Jaejoong Kim <climbbb@gmail.com>: > The hid descriptor identifies the length and type of subordinate >

Re: [PATCH 1/2] USB: serial: console: fix use-after-free on disconnect

2017-10-07 Thread Jaejoong Kim
Hi 2017-10-04 18:01 GMT+09:00 Johan Hovold : > A clean-up patch removing removing two redundant NULL-checks from the ^^ The word 'removing' was written twice. :) > console disconnect handler inadvertently also removed a third

[PATCH v2] HID: usbhid: fix out-of-bounds bug

2017-09-28 Thread Jaejoong Kim
d.c:231 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431 Reported-by: Andrey Konovalov <andreyk...@google.com> Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- Changes in v2: - write a new commit message because orginal version is wrong approach - add check hid descri

Re: [PATCH] HID: usbhid: fix out-of-bounds bug

2017-09-28 Thread Jaejoong Kim
2017-09-27 23:29 GMT+09:00 Alan Stern : > On Wed, 27 Sep 2017, Michel Hermier wrote: > >> Le 27 sept. 2017 07:42, "Alan Stern" a écrit : > >> > - for (n = 0; n < hdesc->bNumDescriptors; n++) >> > + num_descriptors = min_t(int,

Re: write to a UVC device

2017-09-27 Thread Jaejoong Kim
2017-09-28 2:07 GMT+09:00 Rail Shafigulin <r...@esenciatech.com>: > On Mon, Sep 25, 2017 at 7:29 PM, Jaejoong Kim <climbbb@gmail.com> wrote: >> Hi, >> >> The below link will help. >> >> http://git.ideasonboard.org/uvc-gadget.git >> https://lw

Re: [PATCH] HID: usbhid: fix out-of-bounds bug

2017-09-26 Thread Jaejoong Kim
Hi, Alan, Thanks for the review. 2017-09-26 23:18 GMT+09:00 Alan Stern <st...@rowland.harvard.edu>: > On Tue, 26 Sep 2017, Jaejoong Kim wrote: > >> The starting address of the hid descriptor is obtained via >> usb_get_extra_descriptor(). If the hid descr

[PATCH] HID: usbhid: fix out-of-bounds bug

2017-09-26 Thread Jaejoong Kim
ko <gli...@google.com> Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- drivers/hid/usbhid/hid-core.c | 39 +++ include/linux/hid.h | 2 ++ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.

Re: write to a UVC device

2017-09-25 Thread Jaejoong Kim
Hi, The below link will help. http://git.ideasonboard.org/uvc-gadget.git https://lwn.net/Articles/203924/ Jaejoong 2017-09-26 7:06 GMT+09:00 Rail Shafigulin : > Working on a custom Xilinx board with Petalinux on it. Have > /dev/video0 node which is UVC. Tested it with

Re: usb/hid: slab-out-of-bounds read in usbhid_parse

2017-09-20 Thread Jaejoong Kim
Hi Alan 2017-09-21 0:50 GMT+09:00 Alan Stern : > On Wed, 20 Sep 2017, Kim Jaejoong wrote: > >> To. usb & input guys. >> >> While dig this report, i was wondering about bNumDescriptors in HID >> descriptor. >> HID document from usb.org said, 'this number must be at

[PATCH v2 0/2] HID: hiddev: move hiddev's minor number and refactoring

2017-03-03 Thread Jaejoong Kim
Jaejoong Kim (2): HID: cp2112: use proper hidraw name with minor number HID: hiddev: reallocate hiddev's minor number drivers/hid/hid-core.c | 2 +- drivers/hid/hid-cp2112.c| 4 +++- drivers/hid/usbhid/hiddev.c | 15 --- include/linux/hid.h | 1 - include/linux

[PATCH v2 1/2] HID: cp2112: use proper hidraw name with minor number

2017-03-03 Thread Jaejoong Kim
The cp2112 driver is working on hidraw not hiddev. So we need to use proper hidraw name with hidraw's minor number. Reviewed-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com> Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- Changes in v2: - tie in a series --- drivers/hi

[PATCH v2 2/2] HID: hiddev: reallocate hiddev's minor number

2017-03-03 Thread Jaejoong Kim
is always zero. To proper display hiddev's minor number, we need to store the minor number asked from usb core and do some refactoring work (move from hiddev.c to hiddev.h) to access hiddev in hid-core. Reviewed-by: Benjamin Tissoires <benjamin.tissoi...@redhat.com> Signed-off-by: Jaejoo

[PATCH 0/2] HID: hiddev: move hiddev's minor number and refactoring

2017-03-02 Thread Jaejoong Kim
hidraw if it neeeded. So, I move the minor number from hid_device to hiddev and do some refactoring to access struct hiddev in hid-core Jaejoong Kim (2): HID: hiddev: move hiddev's minor number from struct hid_device to hiddev HID: hiddev: store hiddev's minor number when hiddev is connected

[PATCH 1/2] HID: hiddev: move hiddev's minor number from struct hid_device to hiddev

2017-03-02 Thread Jaejoong Kim
We need to store the minor number each drivers. In case of hidraw, it's minor number stores in struct hidraw. But hiddev's minor is located in struct hid_device. So reallocates for hiddev's minor number. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- drivers/hid/usbhid/hiddev

[PATCH 2/2] HID: hiddev: store hiddev's minor number when hiddev is connected

2017-03-02 Thread Jaejoong Kim
-core. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- drivers/hid/hid-core.c | 2 +- drivers/hid/usbhid/hiddev.c | 26 +++--- include/linux/hiddev.h | 24 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/drivers/h

[PATCH v2] HID: hiddev: allocate minor number hiddev's USB interface is bound to

2017-02-15 Thread Jaejoong Kim
hiddev's minor number this interface is bound to. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- Changes in v2: - fix typo in commit message --- drivers/hid/usbhid/hiddev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c

[PATCH] HID: hiddev: allocate minor number hiddev's USB interface is bound to

2017-02-10 Thread Jaejoong Kim
hiddev's minor number this interface is bound to. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- drivers/hid/usbhid/hiddev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 700145b..27e1f8d 100644 --- a/drivers/hid/

[PATCH v2] usb: core: update comments for send message functions

2017-01-17 Thread Jaejoong Kim
() functions note that do not use this function within an interrupt context, like a 'bottom half' handler. With this comment, it makes confuse about usage of these functions. To more clarify, remove 'bottom half' comment. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- Changes in v2: - re

[PATCH v2] usb: core: update comments for send message functions

2017-01-17 Thread Jaejoong Kim
() functions note that do not use this function within an interrupt context, like a 'bottom half' handler. With this comment, it makes confuse about usage of these functions. To more clarify, remove 'bottom half' comment. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- Changes in v2: - re

[PATCH v2] usb: core: update comments for send message functions

2017-01-17 Thread Jaejoong Kim
() functions note that do not use this function within an interrupt context, like a 'bottom half' handler. With this comment, it makes confuse about usage of these functions. To more clarify, remove 'bottom half' comment. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- Changes in v2: - re

[PATCH v2] usb: core: update comments for send message functions

2017-01-17 Thread Jaejoong Kim
() functions note that do not use this function within an interrupt context, like a 'bottom half' handler. With this comment, it makes confuse about usage of these functions. To more clarify, remove 'bottom half' comment. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- Changes in v2: - re

[PATCH] usb: core: update comments for send message functions

2017-01-17 Thread Jaejoong Kim
() functions note that do not use this function within an interrupt context, like a 'bottom half' handler. With this comment, it makes confuse about usage of these functions. To more clarify, remove 'bottom half' comment. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- v2 : reformat comments

[PATCH] usb: core: update comments for send message functions

2017-01-17 Thread Jaejoong Kim
() functions note that do not use this function within an interrupt context, like a 'bottom half' handler. With this comment, it makes confuse about usage of these functions. To more clarify, remove 'bottom half' comment. Signed-off-by: Jaejoong Kim <climbbb@gmail.com> --- I not sure this