History log of /linux-master/sound/isa/gus/gus_mem.c
Revision Date Author Comments
# dec242b6 13-Dec-2021 Takashi Iwai <tiwai@suse.de>

ALSA: gus: Fix memory leaks at memory allocator error paths

When snd_gf1_mem_xalloc() returns NULL, the current code still leaves
the formerly allocated block.name string but returns an error
immediately. This patch does code-refactoring to move the kstrdup()
call itself into snd_gf1_mem_xalloc() and deals with the resource free
in the helper code by itself for fixing those memory leaks.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20211213132444.22385-2-tiwai@suse.de
Link: https://lore.kernel.org/r/20211213141512.27359-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# c2f51415 13-Dec-2021 Takashi Iwai <tiwai@suse.de>

ALSA: gus: Fix erroneous memory allocation

snd_gf1_mem_xalloc() returns NULL incorrectly when the memory chunk is
allocated in the middle of the chain. This patch corrects the return
value to treat it properly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20211213132444.22385-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 78977fd5 13-Dec-2021 Xiaoke Wang <xkernel.wang@foxmail.com>

ALSA: sound/isa/gus: check the return value of kstrdup()

kstrdup() returns NULL when some internal memory errors happen, it is
better to check the return value of it. Otherwise, we may not to be able
to catch some memory errors in time.

Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_1E3950293AC22395ACFE99404C985D738309@qq.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 310efd3a 08-Jun-2021 Takashi Iwai <tiwai@suse.de>

ALSA: gus: Fix assignment in if condition

ISA GUS driver code contains lots of assignments in if condition,
which is a bad coding style that may confuse readers and occasionally
lead to bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1a59d1b8 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
59 temple place suite 330 boston ma 02111 1307 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1334 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4ab1ae34 25-Apr-2019 Fuqian Huang <huangfq.daxian@gmail.com>

ALSA: gus: fix misuse of %x

Pointers should be printed with %p or %px rather than
cast to long type and printed with %lx.
Drop the address printing.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1bac5e1c 04-Feb-2019 Takashi Iwai <tiwai@suse.de>

ALSA: isa: Clean up with new procfs helpers

Simplify the proc fs creation code with new helper functions,
snd_card_ro_proc_new() and snd_card_rw_proc_new().
Just a code refactoring and no functional changes.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 0d64b568 12-Dec-2009 Julia Lawall <julia@diku.dk>

ALSA: sound/isa/gus: Correct code taking the size of a pointer

sizeof(share_id) is just the size of the pointer. On the other hand,
block->share_id is an array, so its size seems more appropriate.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *x;
expression f;
type T;
@@

*f(...,(T)x,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 9004acc7 08-Jan-2008 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove sound/driver.h

This header file exists only for some hacks to adapt alsa-driver
tree. It's useless for building in the kernel. Let's move a few
lines in it to sound/core.h and remove it.
With this patch, sound/driver.h isn't removed but has just a single
compile warning to include it. This should be really killed in
future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# c1017a4c 15-Oct-2007 Jaroslav Kysela <perex@perex.cz>

[ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz


Signed-off-by: Jaroslav Kysela <perex@perex.cz>


# 7ab39926 09-Oct-2006 Clemens Ladisch <clemens@ladisch.de>

[ALSA] use the ALIGN macro

Use the ALIGN macro instead of manual calculations.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>


# bf850204 28-Apr-2006 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove unneeded read/write_size fields in proc text ops

Remove unneeded read/write_size fields in proc text ops.
snd_info_set_text_ops() is fixed, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 8b7547f9 16-Jan-2006 Ingo Molnar <mingo@elte.hu>

[ALSA] semaphore -> mutex (ISA part)

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 5e2da206 17-Nov-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Remove xxx_t typedefs: ISA GUS

Remove xxx_t typedefs from the ISA GUS drivers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 99b359ba 20-Oct-2005 Takashi Iwai <tiwai@suse.de>

[ALSA] Add missing KERN_* suffix to printk

Add missing KERN_* suffix to printk.

Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 543537bd 23-Jun-2005 Paulo Marques <pmarques@grupopie.com>

[PATCH] create a kstrdup library function

This patch creates a new kstrdup library function and changes the "local"
implementations in several places to use this function.

Most of the changes come from the sound and net subsystems. The sound part
had already been acknowledged by Takashi Iwai and the net part by David S.
Miller.

I left UML alone for now because I would need more time to read the code
carefully before making changes there.

Signed-off-by: Paulo Marques <pmarques@grupopie.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 209ac85d 23-May-2005 Adrian Bunk <bunk@stusta.de>

[ALSA] sound/isa/: cleanups

GUS Library
This patch contains the following possible cleanups:
- make needlesly global code static
- #if 0 the following unused global functions:
- gus/gus_volume.c: snd_gf1_gvol_to_lvol_raw
- gus/gus_volume.c: snd_gf1_calc_ramp_rate
- gus/gus_volume.c: snd_gf1_compute_vibrato
- gus/gus_volume.c: snd_gf1_compute_pitchbend
- gus/gus_volume.c: snd_gf1_compute_freq
- gus/gus_io.c: snd_gf1_i_adlib_write
- gus/gus_io.c: snd_gf1_i_write_addr
- gus/gus_io.c: snd_gf1_pokew
- gus/gus_io.c: snd_gf1_peekw
- gus/gus_io.c: snd_gf1_dram_setmem
- gus/gus_io.c: snd_gf1_print_global_registers
- gus/gus_io.c: snd_gf1_print_setup_registers
- gus/gus_io.c: snd_gf1_peek_print_block
- gus/gus_io.c: snd_gf1_print_setup_registers
- gus/gus_io.c: snd_gf1_peek_print_block
- #if 0 the following unused global variable:
- gus/gus_tables.h: snd_gf1_scale_table
- remove the following unneeded EXPORT_SYMBOL's:
- gus/gus_main.c: snd_gf1_i_write16
- gus/gus_main.c: snd_gf1_start
- gus/gus_main.c: snd_gf1_stop

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 1da177e4 16-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org>

Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!