sound: rawmidi: fix double init when opening MIDI device with O_APPEND
commitdfe0b47c1e940dbe2f59133c08c485dee78668c5
authorClemens Ladisch <clemens@ladisch.de>
Wed, 21 Oct 2009 07:09:38 +0000 (21 09:09 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 8 Dec 2009 18:21:06 +0000 (8 10:21 -0800)
tree758d4d9800d8305c1e4e567ad04c14ee805a3904
parent1a65ef117b0bcb58f5e8b97dc477728e98d3a795
sound: rawmidi: fix double init when opening MIDI device with O_APPEND

commit 8579d2d7779d7ff41ea2a0183015e0e5038f1043 upstream.

Commit 9a1b64caac82aa02cb74587ffc798e6f42c6170a in 2.6.30 moved the
substream initialization code to where it would be executed every time
the substream is opened.

This had the consequence that any further opening would drop and leak
the data in the existing buffer, and that the device driver's open
callback would be called multiple times, unexpectedly.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/core/rawmidi.c