<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/gadget/function/f_midi.c, branch v4.3.1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.3.1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.3.1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2015-07-31T13:57:59+00:00</updated>
<entry>
<title>usb: gadget: midi: avoid redundant f_midi_set_alt() call</title>
<updated>2015-07-31T13:57:59+00:00</updated>
<author>
<name>Robert Baldyga</name>
<email>r.baldyga@samsung.com</email>
</author>
<published>2015-07-13T09:03:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4ef7a4a1f097b2c17f4f2873a1595aa0aca9f6b4'/>
<id>urn:sha1:4ef7a4a1f097b2c17f4f2873a1595aa0aca9f6b4</id>
<content type='text'>
Function midi registers two interfaces with single set_alt() function
which means that f_midi_set_alt() is called twice when configuration
is set. That means that endpoint initialization and ep request allocation
is done two times. To avoid this problem we do such things only once,
for interface number 1 (MIDI Streaming interface).

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Acked-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_midi: fix error recovery path</title>
<updated>2015-07-06T17:34:08+00:00</updated>
<author>
<name>Andrzej Pietrasiewicz</name>
<email>andrzej.p@samsung.com</email>
</author>
<published>2015-07-03T12:02:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b2e2c94b878be2500d4d42c1f52a2fa1fe7648b4'/>
<id>urn:sha1:b2e2c94b878be2500d4d42c1f52a2fa1fe7648b4</id>
<content type='text'>
In case kstrdup() fails the resources to release are
midi-&gt;in_port[] and midi. No cards have been registered,
so no need to unregister any.

Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_midi: fix segfault when reading empty id</title>
<updated>2015-05-14T19:04:57+00:00</updated>
<author>
<name>Pawel Szewczyk</name>
<email>p.szewczyk@samsung.com</email>
</author>
<published>2015-05-14T12:14:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a25a23cc85a28090bf8ab0e750b48e7ab283ba8a'/>
<id>urn:sha1:a25a23cc85a28090bf8ab0e750b48e7ab283ba8a</id>
<content type='text'>
When midi function is created, 'id' attribute is initialized with
SNDRV_DEFAULT_STR1, which is NULL pointer. Trying to read this attribute
before filling it ends up with segmentation fault.

This commit fix this issue by preventing null pointer dereference. Now
f_midi_opts_id_show() returns empty string when id is a null pointer.

Reproduction path:

$ mkdir functions/midi.0
$ cat functions/midi.0/id

[   53.130132] Unable to handle kernel NULL pointer dereference at
virtual address 00000000
[   53.132630] pgd = ec6cc000
[   53.135308] [00000000] *pgd=6b759831, *pte=00000000, *ppte=00000000
[   53.141530] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[   53.146904] Modules linked in: usb_f_midi snd_rawmidi libcomposite
[   53.153071] CPU: 1 PID: 2936 Comm: cat Not tainted
3.19.0-00041-gcf4b216 #7
[   53.160010] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[   53.166088] task: ee234c80 ti: ec764000 task.ti: ec764000
[   53.171482] PC is at strlcpy+0x8/0x60
[   53.175128] LR is at f_midi_opts_id_show+0x28/0x3c [usb_f_midi]
[   53.181019] pc : [&lt;c0222a9c&gt;]    lr : [&lt;bf01bed0&gt;]    psr: 60000053
[   53.181019] sp : ec765ef8  ip : 00000141  fp : 00000000
[   53.192474] r10: 00019000  r9 : ed7546c0  r8 : 00010000
[   53.197682] r7 : ec765f80  r6 : eb46a000  r5 : eb46a000  r4 :
ed754734
[   53.204192] r3 : ee234c80  r2 : 00001000  r1 : 00000000  r0 :
eb46a000
[   53.210704] Flags: nZCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM
Segment user
[   53.217907] Control: 10c5387d  Table: 6c6cc04a  DAC: 00000015
[   53.223636] Process cat (pid: 2936, stack limit = 0xec764238)
[   53.229364] Stack: (0xec765ef8 to 0xec766000)
[   53.233706] 5ee0:
ed754734 ed7546c0
[   53.241866] 5f00: eb46a000 bf01bed0 eb753b80 bf01cc44 eb753b98
bf01b0a4 bf01b08c c0125dd0
[   53.250025] 5f20: 00002f19 00000000 ec432e00 bf01cce8 c0530c00
00019000 00010000 ec765f80
[   53.258184] 5f40: 00010000 ec764000 00019000 c00cc4ac ec432e00
c00cc55c 00000017 000081a4
[   53.266343] 5f60: 00000001 00000000 00000000 ec432e00 ec432e00
00010000 00019000 c00cc620
[   53.274502] 5f80: 00000000 00000000 00000000 00010000 ffff1000
00019000 00000003 c000e9a8
[   53.282662] 5fa0: 00000000 c000e7e0 00010000 ffff1000 00000003
00019000 00010000 00019000
[   53.290821] 5fc0: 00010000 ffff1000 00019000 00000003 7fffe000
00000001 00000000 00000000
[   53.298980] 5fe0: 00000000 be8c68d4 0000b995 b6f0e3e6 40000070
00000003 00000000 00000000
[   53.307157] [&lt;c0222a9c&gt;] (strlcpy) from [&lt;bf01bed0&gt;]
(f_midi_opts_id_show+0x28/0x3c [usb_f_midi])
[   53.316006] [&lt;bf01bed0&gt;] (f_midi_opts_id_show [usb_f_midi]) from
[&lt;bf01b0a4&gt;] (f_midi_opts_attr_show+0x18/0x24 )
[   53.327209] [&lt;bf01b0a4&gt;] (f_midi_opts_attr_show [usb_f_midi]) from
[&lt;c0125dd0&gt;] (configfs_read_file+0x9c/0xec)
[   53.337180] [&lt;c0125dd0&gt;] (configfs_read_file) from [&lt;c00cc4ac&gt;]
(__vfs_read+0x18/0x4c)
[   53.345073] [&lt;c00cc4ac&gt;] (__vfs_read) from [&lt;c00cc55c&gt;]
(vfs_read+0x7c/0x100)
[   53.352190] [&lt;c00cc55c&gt;] (vfs_read) from [&lt;c00cc620&gt;]
(SyS_read+0x40/0x8c)
[   53.359056] [&lt;c00cc620&gt;] (SyS_read) from [&lt;c000e7e0&gt;]
(ret_fast_syscall+0x0/0x34)
[   53.366513] Code: ebffe3d3 e8bd8008 e92d4070 e1a05000 (e5d14000)
[   53.372641] ---[ end trace e4f53a4e233d98d0 ]---

Signed-off-by: Pawel Szewczyk &lt;p.szewczyk@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: fix misspelling of current function in string</title>
<updated>2014-12-22T16:27:34+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2014-12-07T19:21:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c9b3bde03b95cf1cab068f773435cfee271baf0b'/>
<id>urn:sha1:c9b3bde03b95cf1cab068f773435cfee271baf0b</id>
<content type='text'>
Replace a misspelled function name by %s and then __func__.

This was done using Coccinelle, including the use of Levenshtein distance,
as proposed by Rasmus Villemoes.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: midi: f_midi_alloc() can be static</title>
<updated>2014-11-12T15:01:03+00:00</updated>
<author>
<name>Fengguang Wu</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2014-11-12T13:28:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f509fee81fa205c664ea4e446b6d8a8caae38c35'/>
<id>urn:sha1:f509fee81fa205c664ea4e446b6d8a8caae38c35</id>
<content type='text'>
drivers/usb/gadget/function/f_midi.c:1072:21: sparse: symbol 'f_midi_alloc' was not declared. Should it be static?
drivers/usb/gadget/legacy/gmidi.c:118:30: sparse: symbol 'fi_midi' was not declared. Should it be static?
drivers/usb/gadget/legacy/gmidi.c:119:21: sparse: symbol 'f_midi' was not declared. Should it be static?

Signed-off-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_midi: add configfs support</title>
<updated>2014-11-05T19:37:17+00:00</updated>
<author>
<name>Andrzej Pietrasiewicz</name>
<email>andrzej.p@samsung.com</email>
</author>
<published>2014-10-16T11:33:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6f1de344557315a8e5de0d15a28276198ca7fdac'/>
<id>urn:sha1:6f1de344557315a8e5de0d15a28276198ca7fdac</id>
<content type='text'>
Make the midi function available for gadgets composed with configfs.

Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_midi: use usb_gstrings_attach</title>
<updated>2014-11-05T19:36:20+00:00</updated>
<author>
<name>Andrzej Pietrasiewicz</name>
<email>andrzej.p@samsung.com</email>
</author>
<published>2014-10-16T11:33:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9caa0d77f7ce6ca0ec6bb81e28a93db1b6287b0f'/>
<id>urn:sha1:9caa0d77f7ce6ca0ec6bb81e28a93db1b6287b0f</id>
<content type='text'>
In order to add configfs support the usb_gstrings_attach must be used.

Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_midi: remove compatibility layer</title>
<updated>2014-11-05T19:36:17+00:00</updated>
<author>
<name>Andrzej Pietrasiewicz</name>
<email>andrzej.p@samsung.com</email>
</author>
<published>2014-10-16T11:33:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=33cfad66efbb72de0ebe72f554b31b6688957052'/>
<id>urn:sha1:33cfad66efbb72de0ebe72f554b31b6688957052</id>
<content type='text'>
There are no old f_midi interface users left, so remove it.

Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_midi: convert to new function interface with backward compatibility</title>
<updated>2014-11-05T19:36:09+00:00</updated>
<author>
<name>Andrzej Pietrasiewicz</name>
<email>andrzej.p@samsung.com</email>
</author>
<published>2014-10-16T11:33:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b85e9de9e818de0dcbc50b7b4242192eb6194855'/>
<id>urn:sha1:b85e9de9e818de0dcbc50b7b4242192eb6194855</id>
<content type='text'>
Converting midi to the new function interface requires converting
the USB midi's function code and its users.

This patch converts the f_midi.c to the new function interface.
The file can now be compiled into a separate usb_f_midi.ko module.

The old function interface is provided by means of a preprocessor
conditional directives. After all users are converted, the old interface
can be removed.

Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_midi: check kstrdup() return value</title>
<updated>2014-11-05T19:36:05+00:00</updated>
<author>
<name>Andrzej Pietrasiewicz</name>
<email>andrzej.p@samsung.com</email>
</author>
<published>2014-10-16T11:33:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d23b4c3ee2d5cbdeaec9f8e7d8a9bdcc73836fb9'/>
<id>urn:sha1:d23b4c3ee2d5cbdeaec9f8e7d8a9bdcc73836fb9</id>
<content type='text'>
kstrdup() might fail, so check its return value and react appropriately.

Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
</feed>
