ALSA: emux: fix init of patch_info.truesize in load_data()
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Sat, 6 Apr 2024 06:48:17 +0000 (08:48 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 7 Apr 2024 06:35:46 +0000 (08:35 +0200)
The field is explicitly documented to be initialized by the driver
(which it actually is). Also, using patch_info.size would be actually
wrong for 16-bit data, as one field counts samples, while the other
counts bytes.

load_guspatch() already did it right.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Message-ID: <20240406064830.1029573-5-oswald.buddenhagen@gmx.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/synth/emux/soundfont.c

index e1e47518ac92c54a741219e39cfae96a828fd4aa..ad0231d7a39db9b6211b1961131010c48c41f6c4 100644 (file)
@@ -735,7 +735,7 @@ load_data(struct snd_sf_list *sflist, const void __user *data, long count)
        sp->v = sample_info;
        sp->v.sf_id = sf->id;
        sp->v.dummy = 0;
-       sp->v.truesize = sp->v.size;
+       sp->v.truesize = 0;
 
        /*
         * If there is wave data then load it.