ALSA: Use safer strscpy() instead of strcpy()
Subsystems (13)
cover ALSA: Use safer strscpy() instead of strcpy()
Hi,
this is a collection of small and pretty trivial patches to replace the strcpy() calls with strscpy(). Most of changes (except for a few last ones) are systematic replacement with strscpy() where the copy is done against arrays, so pretty safe.
Takashi
===
Takashi Iwai (103):
ALSA: control: Use safer strscpy() instead of strcpy()
ALSA: rawmidi: Use safer strscpy() instead of strcpy()
ALSA: seq: Use safer strscpy() instead of strcpy()
ALSA: mpu401: Use safer strscpy() instead of strcpy()
ALSA: opl3: Use safer strscpy() instead of strcpy()
ALSA: opl4: Use safer strscpy() instead of strcpy()
ALSA: pcsp: Use safer strscpy() instead of strcpy()
ALSA: portman2x4: Use safer strscpy() instead of strcpy()
ALSA: serial-generic: Use safer strscpy() instead of strcpy()
ALSA: serial-u16550: Use safer strscpy() instead of strcpy()
ALSA: virmidi: Use safer strscpy() instead of strcpy()
ALSA: vx: Use safer strscpy() instead of strcpy()
ALSA: firewire: bebob: Use safer strscpy() instead of strcpy()
ALSA: firewire: dice: Use safer strscpy() instead of strcpy()
ALSA: firewire: digi00x: Use safer strscpy() instead of strcpy()
ALSA: firewire: fireface: Use safer strscpy() instead of strcpy()
ALSA: firewire: fireworks: Use safer strscpy() instead of strcpy()
ALSA: firewire: isight: Use safer strscpy() instead of strcpy()
ALSA: firewire: motu: Use safer strscpy() instead of strcpy()
ALSA: firewire: oxfw: Use safer strscpy() instead of strcpy()
ALSA: firewire: tascam: Use safer strscpy() instead of strcpy()
ALSA: ad1816a: Use safer strscpy() instead of strcpy()
ALSA: adlib: Use safer strscpy() instead of strcpy()
ALSA: als100: Use safer strscpy() instead of strcpy()
ALSA: cmi8328: Use safer strscpy() instead of strcpy()
ALSA: cmi8330: Use safer strscpy() instead of strcpy()
ALSA: cs423x: Use safer strscpy() instead of strcpy()
ALSA: es1688: Use safer strscpy() instead of strcpy()
ALSA: es18xx: Use safer strscpy() instead of strcpy()
ALSA: galaxy: Use safer strscpy() instead of strcpy()
ALSA: gus: Use safer strscpy() instead of strcpy()
ALSA: msnd: Use safer strscpy() instead of strcpy()
ALSA: opl3sa2: Use safer strscpy() instead of strcpy()
ALSA: opti9xx: Use safer strscpy() instead of strcpy()
ALSA: sc6000: Use safer strscpy() instead of strcpy()
ALSA: sscape: Use safer strscpy() instead of strcpy()
ALSA: wavefront: Use safer strscpy() instead of strcpy()
ALSA: wss: Use safer strscpy() instead of strcpy()
ALSA: mips: Use safer strscpy() instead of strcpy()
ALSA: parisc: Use safer strscpy() instead of strcpy()
ALSA: ac97: Use safer strscpy() instead of strcpy()
ALSA: ad1889: Use safer strscpy() instead of strcpy()
ALSA: ak4531: Use safer strscpy() instead of strcpy()
ALSA: ali5451: Use safer strscpy() instead of strcpy()
ALSA: als300: Use safer strscpy() instead of strcpy()
ALSA: als4000: Use safer strscpy() instead of strcpy()
ALSA: asihpi: Use safer strscpy() instead of strcpy()
ALSA: atiixp: Use safer strscpy() instead of strcpy()
ALSA: au88x0: Use safer strscpy() instead of strcpy()
ALSA: aw2: Use safer strscpy() instead of strcpy()
ALSA: azt3328: Use safer strscpy() instead of strcpy()
ALSA: bt87x: Use safer strscpy() instead of strcpy()
ALSA: ca0106: Use safer strscpy() instead of strcpy()
ALSA: cmipci: Use safer strscpy() instead of strcpy()
ALSA: cs4281: Use safer strscpy() instead of strcpy()
ALSA: cs46xx: Use safer strscpy() instead of strcpy()
ALSA: cs5530: Use safer strscpy() instead of strcpy()
ALSA: cs5535audio: Use safer strscpy() instead of strcpy()
ALSA: ctxfi: Use safer strscpy() instead of strcpy()
ALSA: echoaudio: Use safer strscpy() instead of strcpy()
ALSA: emu10k1: Use safer strscpy() instead of strcpy()
ALSA: ens1370: Use safer strscpy() instead of strcpy()
ALSA: es1938: Use safer strscpy() instead of strcpy()
ALSA: es1968: Use safer strscpy() instead of strcpy()
ALSA: fm801: Use safer strscpy() instead of strcpy()
ALSA: ice1712: Use safer strscpy() instead of strcpy()
ALSA: ice1724: Use safer strscpy() instead of strcpy()
ALSA: intel8x0: Use safer strscpy() instead of strcpy()
ALSA: korg1212: Use safer strscpy() instead of strcpy()
ALSA: lola: Use safer strscpy() instead of strcpy()
ALSA: lx6464es: Use safer strscpy() instead of strcpy()
ALSA: maestro3: Use safer strscpy() instead of strcpy()
ALSA: mixart: Use safer strscpy() instead of strcpy()
ALSA: nm256: Use safer strscpy() instead of strcpy()
ALSA: oxygen: Use safer strscpy() instead of strcpy()
ALSA: pcxhr: Use safer strscpy() instead of strcpy()
ALSA: riptide: Use safer strscpy() instead of strcpy()
ALSA: rme32: Use safer strscpy() instead of strcpy()
ALSA: rme96: Use safer strscpy() instead of strcpy()
ALSA: hdsp: Use safer strscpy() instead of strcpy()
ALSA: hdspm: Use safer strscpy() instead of strcpy()
ALSA: rme9652: Use safer strscpy() instead of strcpy()
ALSA: Use safer strscpy() instead of strcpy()
ALSA: sonicvibes: Use safer strscpy() instead of strcpy()
ALSA: trident: Use safer strscpy() instead of strcpy()
ALSA: via82xx: Use safer strscpy() instead of strcpy()
ALSA: ymfpci: Use safer strscpy() instead of strcpy()
ALSA: pdaudiocf: Use safer strscpy() instead of strcpy()
ALSA: vxpocket: Use safer strscpy() instead of strcpy()
ALSA: ppc: Use safer strscpy() instead of strcpy()
ALSA: sh: Use safer strscpy() instead of strcpy()
ALSA: sparc: Use safer strscpy() instead of strcpy()
ALSA: spi: Use safer strscpy() instead of strcpy()
ALSA: synth: Use safer strscpy() instead of strcpy()
ALSA: 6fire: Use safer strscpy() instead of strcpy()
ALSA: line6: Use safer strscpy() instead of strcpy()
ALSA: usx2y: Use safer strscpy() instead of strcpy()
ALSA: ua101: Use safer strscpy() instead of strcpy()
ALSA: usb-audio: Use safer strscpy() instead of strcpy()
ALSA: ac97: Copy string more safely
ALSA: cmipci: Copy string more safely
ALSA: usb-audio: Copy string more safely
ALSA: core: Copy string more safely
sound/core/control.c | 2 +- sound/core/init.c | 16 +++++----- sound/core/rawmidi.c | 6 ++-- sound/core/seq/oss/seq_oss_init.c | 4 +-- sound/core/seq/seq_clientmgr.c | 2 +- sound/core/seq/seq_midi.c | 2 +- sound/core/seq/seq_system.c | 4 +-- sound/core/seq/seq_ump_client.c | 2 +- sound/core/seq/seq_virmidi.c | 2 +- sound/drivers/mpu401/mpu401.c | 4 +-- sound/drivers/opl3/opl3_lib.c | 14 ++++----- sound/drivers/opl4/opl4_lib.c | 2 +- sound/drivers/pcsp/pcsp.c | 4 +-- sound/drivers/pcsp/pcsp_lib.c | 2 +- sound/drivers/pcsp/pcsp_mixer.c | 2 +- sound/drivers/portman2x4.c | 6 ++-- sound/drivers/serial-generic.c | 4 +-- sound/drivers/serial-u16550.c | 6 ++-- sound/drivers/virmidi.c | 6 ++-- sound/drivers/vx/vx_core.c | 2 +- sound/drivers/vx/vx_mixer.c | 2 +- sound/drivers/vx/vx_pcm.c | 2 +- sound/firewire/bebob/bebob.c | 6 ++-- sound/firewire/bebob/bebob_hwdep.c | 2 +- sound/firewire/dice/dice-hwdep.c | 2 +- sound/firewire/dice/dice-pcm.c | 2 +- sound/firewire/dice/dice.c | 10 +++---- sound/firewire/digi00x/digi00x-hwdep.c | 2 +- sound/firewire/digi00x/digi00x.c | 6 ++-- sound/firewire/fireface/ff-hwdep.c | 2 +- sound/firewire/fireface/ff.c | 6 ++-- sound/firewire/fireworks/fireworks.c | 6 ++-- sound/firewire/fireworks/fireworks_hwdep.c | 2 +- sound/firewire/isight.c | 8 ++--- sound/firewire/motu/motu-hwdep.c | 2 +- sound/firewire/motu/motu-pcm.c | 2 +- sound/firewire/motu/motu.c | 6 ++-- sound/firewire/oxfw/oxfw-hwdep.c | 2 +- sound/firewire/oxfw/oxfw-pcm.c | 2 +- sound/firewire/oxfw/oxfw.c | 6 ++-- sound/firewire/tascam/tascam-hwdep.c | 2 +- sound/firewire/tascam/tascam.c | 6 ++-- sound/isa/ad1816a/ad1816a.c | 4 +-- sound/isa/ad1816a/ad1816a_lib.c | 6 ++-- sound/isa/adlib.c | 4 +-- sound/isa/als100.c | 8 ++--- sound/isa/cmi8328.c | 20 ++++++------- sound/isa/cmi8330.c | 8 ++--- sound/isa/cs423x/cs4236.c | 2 +- sound/isa/cs423x/cs4236_lib.c | 2 +- sound/isa/es1688/es1688_lib.c | 4 +-- sound/isa/es18xx.c | 2 +- sound/isa/galaxy/galaxy.c | 4 +-- sound/isa/gus/gus_main.c | 16 +++++----- sound/isa/gus/gus_mixer.c | 2 +- sound/isa/gus/gus_pcm.c | 2 +- sound/isa/gus/gus_timer.c | 4 +-- sound/isa/gus/gus_uart.c | 2 +- sound/isa/gus/gusextreme.c | 8 ++--- sound/isa/gus/gusmax.c | 16 +++++----- sound/isa/gus/interwave.c | 34 +++++++++++----------- sound/isa/msnd/msnd.c | 2 +- sound/isa/msnd/msnd_pinnacle.c | 22 +++++++------- sound/isa/msnd/msnd_pinnacle_mixer.c | 2 +- sound/isa/opl3sa2.c | 20 ++++++------- sound/isa/opti9xx/miro.c | 8 ++--- sound/isa/opti9xx/opti92x-ad1848.c | 18 ++++++------ sound/isa/sc6000.c | 20 ++++++------- sound/isa/sscape.c | 4 +-- sound/isa/wavefront/wavefront.c | 16 +++++----- sound/isa/wss/wss_lib.c | 6 ++-- sound/mips/hal2.c | 6 ++-- sound/parisc/harmony.c | 8 ++--- sound/pci/ac97/ac97_codec.c | 23 ++++++++------- sound/pci/ac97/ac97_local.h | 2 +- sound/pci/ac97/ac97_patch.c | 8 ++--- sound/pci/ac97/ac97_proc.c | 2 +- sound/pci/ad1889.c | 6 ++-- sound/pci/ak4531_codec.c | 2 +- sound/pci/ali5451/ali5451.c | 6 ++-- sound/pci/als300.c | 4 +-- sound/pci/als4000.c | 4 +-- sound/pci/asihpi/asihpi.c | 10 +++---- sound/pci/asihpi/hpi6000.c | 2 +- sound/pci/atiixp.c | 10 +++---- sound/pci/atiixp_modem.c | 6 ++-- sound/pci/au88x0/au88x0.c | 4 +-- sound/pci/au88x0/au88x0_mixer.c | 2 +- sound/pci/aw2/aw2-alsa.c | 10 +++---- sound/pci/azt3328.c | 12 ++++---- sound/pci/bt87x.c | 6 ++-- sound/pci/ca0106/ca0106_main.c | 6 ++-- sound/pci/ca0106/ca0106_mixer.c | 4 +-- sound/pci/ca0106/ca_midi.c | 2 +- sound/pci/cmipci.c | 25 ++++++++-------- sound/pci/cs4281.c | 8 ++--- sound/pci/cs46xx/cs46xx.c | 4 +-- sound/pci/cs46xx/cs46xx_lib.c | 20 ++++++------- sound/pci/cs46xx/dsp_spos.c | 8 ++--- sound/pci/cs5530.c | 4 +-- sound/pci/cs5535audio/cs5535audio.c | 4 +-- sound/pci/cs5535audio/cs5535audio_pcm.c | 2 +- sound/pci/ctxfi/ctmixer.c | 2 +- sound/pci/echoaudio/midi.c | 2 +- sound/pci/emu10k1/emumpu401.c | 2 +- sound/pci/emu10k1/emupcm.c | 10 +++---- sound/pci/emu10k1/p16v.c | 2 +- sound/pci/emu10k1/timer.c | 2 +- sound/pci/ens1370.c | 10 +++---- sound/pci/es1938.c | 8 ++--- sound/pci/es1968.c | 14 ++++----- sound/pci/fm801.c | 6 ++-- sound/pci/ice1712/ice1712.c | 14 ++++----- sound/pci/ice1712/ice1724.c | 18 ++++++------ sound/pci/intel8x0.c | 14 ++++----- sound/pci/intel8x0m.c | 10 +++---- sound/pci/korg1212/korg1212.c | 6 ++-- sound/pci/lola/lola.c | 4 +-- sound/pci/lx6464es/lx6464es.c | 4 +-- sound/pci/maestro3.c | 8 ++--- sound/pci/mixart/mixart.c | 6 ++-- sound/pci/nm256/nm256.c | 6 ++-- sound/pci/oxygen/oxygen_lib.c | 6 ++-- sound/pci/oxygen/oxygen_pcm.c | 8 ++--- sound/pci/pcxhr/pcxhr.c | 4 +-- sound/pci/riptide/riptide.c | 6 ++-- sound/pci/rme32.c | 12 ++++---- sound/pci/rme96.c | 16 +++++----- sound/pci/rme9652/hdsp.c | 12 ++++---- sound/pci/rme9652/hdspm.c | 8 ++--- sound/pci/rme9652/rme9652.c | 12 ++++---- sound/pci/sis7019.c | 6 ++-- sound/pci/sonicvibes.c | 8 ++--- sound/pci/trident/trident.c | 6 ++-- sound/pci/trident/trident_main.c | 14 ++++----- sound/pci/via82xx.c | 20 ++++++------- sound/pci/via82xx_modem.c | 4 +-- sound/pci/ymfpci/ymfpci.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 8 ++--- sound/pcmcia/pdaudiocf/pdaudiocf.c | 2 +- sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | 2 +- sound/pcmcia/vx/vxpocket.c | 2 +- sound/ppc/awacs.c | 2 +- sound/ppc/burgundy.c | 2 +- sound/ppc/daca.c | 2 +- sound/ppc/pmac.c | 2 +- sound/ppc/powermac.c | 8 ++--- sound/ppc/snd_ps3.c | 8 ++--- sound/sh/aica.c | 8 ++--- sound/sh/sh_dac_audio.c | 6 ++-- sound/sparc/cs4231.c | 14 ++++----- sound/spi/at73c213.c | 8 ++--- sound/synth/emux/emux_hwdep.c | 2 +- sound/synth/emux/emux_oss.c | 2 +- sound/usb/6fire/chip.c | 4 +-- sound/usb/6fire/midi.c | 2 +- sound/usb/6fire/pcm.c | 2 +- sound/usb/card.c | 13 +++++---- sound/usb/line6/driver.c | 8 ++--- sound/usb/line6/midi.c | 4 +-- sound/usb/line6/pcm.c | 2 +- sound/usb/line6/toneport.c | 2 +- sound/usb/midi.c | 2 +- sound/usb/midi2.c | 3 +- sound/usb/misc/ua101.c | 6 ++-- sound/usb/mixer.c | 24 +++++++-------- sound/usb/mixer_scarlett.c | 31 +++++++++++--------- sound/usb/mixer_scarlett2.c | 14 +++++---- sound/usb/proc.c | 2 +- sound/usb/stream.c | 5 ++-- sound/usb/usx2y/us122l.c | 2 +- sound/usb/usx2y/usX2Yhwdep.c | 2 +- sound/usb/usx2y/usbusx2y.c | 2 +- 173 files changed, 588 insertions(+), 576 deletions(-)
Signature · 1 line
2.50.0
PATCH 1/103 ALSA: control: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/core/control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/control.c +1 -1
@@ -1435,7 +1435,7 @@ static int snd_ctl_elem_user_enum_info(struct snd_kcontrol *kcontrol, names = ue->priv_data;for (; item >0 ; --item) names +=strlen (names) +1 ; -strcpy (uinfo->value.enumerated.name, names); +strscpy (uinfo->value.enumerated.name, names);return 0 ; }
Signature · 1 line
2.50.0
PATCH 2/103 ALSA: rawmidi: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/core/rawmidi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/core/rawmidi.c +3 -3
@@ -631,9 +631,9 @@ static int snd_rawmidi_info(struct snd_rawmidi_substream *substream, info->flags = rmidi->info_flags;if (substream->inactive) info->flags |=SNDRV_RAWMIDI_INFO_STREAM_INACTIVE ; -strcpy (info->id, rmidi->id); -strcpy (info->name, rmidi->name); -strcpy (info->subname, substream->name); +strscpy (info->id, rmidi->id); +strscpy (info->name, rmidi->name); +strscpy (info->subname, substream->name); info->subdevices_count = substream->pstr->substream_count; info->subdevices_avail = (substream->pstr->substream_count - substream->pstr->substream_opened);
Signature · 1 line
2.50.0
PATCH 3/103 ALSA: seq: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/core/seq/oss/seq_oss_init.c | 4 ++-- sound/core/seq/seq_clientmgr.c | 2 +- sound/core/seq/seq_midi.c | 2 +- sound/core/seq/seq_system.c | 4 ++-- sound/core/seq/seq_ump_client.c | 2 +- sound/core/seq/seq_virmidi.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-)
sound/core/seq/oss/seq_oss_init.c +2 -2
@@ -79,7 +79,7 @@ snd_seq_oss_create_client(void) system_client = rc;/* create announcement receiver port */ -strcpy (port->name,"Receiver" ); +strscpy (port->name,"Receiver" ); port->addr.client = system_client; port->capability =SNDRV_SEQ_PORT_CAP_WRITE ;/* receive only */ port->type =0 ;
@@ -347,7 +347,7 @@ alloc_seq_queue(struct seq_oss_devinfo *dp)memset (&qinfo,0 ,sizeof (qinfo)); qinfo.owner = system_client; qinfo.locked =1 ; -strcpy (qinfo.name,"OSS Sequencer Emulation" ); +strscpy (qinfo.name,"OSS Sequencer Emulation" ); rc =call_ctl (SNDRV_SEQ_IOCTL_CREATE_QUEUE , &qinfo);if (rc <0 )return rc;
sound/core/seq/seq_clientmgr.c +1 -1
@@ -1256,7 +1256,7 @@ static void get_client_info(struct snd_seq_client *cptr,/* fill the info fields */ info->type = cptr->type; -strcpy (info->name, cptr->name); +strscpy (info->name, cptr->name); info->filter = cptr->filter; info->event_lost = cptr->event_lost;memcpy (info->event_filter, cptr->event_filter,32 );
sound/core/seq/seq_midi.c +1 -1
@@ -344,7 +344,7 @@ snd_seq_midisynth_probe(struct device *_dev) info->stream =SNDRV_RAWMIDI_STREAM_INPUT ; info->subdevice = p;if (snd_rawmidi_info_select (card, info) >=0 ) -strcpy (port->name, info->subname); +strscpy (port->name, info->subname);if (! port->name[0 ]) {if (info->name[0 ]) {if (ports >1 )
sound/core/seq/seq_system.c +2 -2
@@ -146,7 +146,7 @@ int __init snd_seq_system_client_init(void) }/* register timer */ -strcpy (port->name,"Timer" ); +strscpy (port->name,"Timer" ); port->capability =SNDRV_SEQ_PORT_CAP_WRITE ;/* accept queue control */ port->capability |=SNDRV_SEQ_PORT_CAP_READ |SNDRV_SEQ_PORT_CAP_SUBS_READ ;/* for broadcast */ port->kernel = &pcallbacks;
@@ -160,7 +160,7 @@ int __init snd_seq_system_client_init(void) goto error_port;/* register announcement port */ -strcpy (port->name,"Announce" ); +strscpy (port->name,"Announce" ); port->capability =SNDRV_SEQ_PORT_CAP_READ |SNDRV_SEQ_PORT_CAP_SUBS_READ ;/* for broadcast only */ pcallbacks.event_input =NULL ; pcallbacks.subscribe = sys_announce_subscribe;
sound/core/seq/seq_ump_client.c +1 -1
@@ -310,7 +310,7 @@ static int create_ump_endpoint_port(struct seq_ump_client *client)SNDRV_SEQ_PORT_TYPE_HARDWARE |SNDRV_SEQ_PORT_TYPE_PORT ; port->midi_channels =16 ; -strcpy (port->name,"MIDI 2.0" ); +strscpy (port->name,"MIDI 2.0" );memset (&pcallbacks,0 ,sizeof (pcallbacks)); pcallbacks.owner =THIS_MODULE ; pcallbacks.private_data = client;
sound/core/seq/seq_virmidi.c +1 -1
@@ -497,7 +497,7 @@ int snd_virmidi_new(struct snd_card *card, int device, struct snd_rawmidi **rrmi &rmidi);if (err <0 )return err; -strcpy (rmidi->name, rmidi->id); +strscpy (rmidi->name, rmidi->id); rdev =kzalloc (sizeof (*rdev),GFP_KERNEL );if (rdev ==NULL ) {snd_device_free (card, rmidi);
Signature · 1 line
2.50.0
PATCH 4/103 ALSA: mpu401: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/drivers/mpu401/mpu401.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/drivers/mpu401/mpu401.c +2 -2
@@ -63,8 +63,8 @@ static int snd_mpu401_create(struct device *devptr, int dev, 0, &card);if (err <0 )return err; -strcpy (card->driver,"MPU-401 UART" ); -strcpy (card->shortname, card->driver); +strscpy (card->driver,"MPU-401 UART" ); +strscpy (card->shortname, card->driver);sprintf (card->longname,"%s at %#lx, " , card->shortname, port[dev]);if (irq[dev] >=0 ) {sprintf (card->longname +strlen (card->longname),"irq %d" , irq[dev]);
Signature · 1 line
2.50.0
PATCH 5/103 ALSA: opl3: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/drivers/opl3/opl3_lib.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/drivers/opl3/opl3_lib.c +7 -7
@@ -245,7 +245,7 @@ static int snd_opl3_timer1_init(struct snd_opl3 * opl3, int timer_no) tid.subdevice =0 ; err =snd_timer_new (opl3->card,"AdLib timer #1" , &tid, &timer);if (err >=0 ) { -strcpy (timer->name,"AdLib timer #1" ); +strscpy (timer->name,"AdLib timer #1" ); timer->private_data = opl3; timer->hw = snd_opl3_timer1; }
@@ -266,7 +266,7 @@ static int snd_opl3_timer2_init(struct snd_opl3 * opl3, int timer_no) tid.subdevice =0 ; err =snd_timer_new (opl3->card,"AdLib timer #2" , &tid, &timer);if (err >=0 ) { -strcpy (timer->name,"AdLib timer #2" ); +strscpy (timer->name,"AdLib timer #2" ); timer->private_data = opl3; timer->hw = snd_opl3_timer2; }
@@ -497,18 +497,18 @@ int snd_opl3_hwdep_new(struct snd_opl3 * opl3,if (device ==0 ) hw->oss_type =SNDRV_OSS_DEVICE_TYPE_DMFM ;#endif -strcpy (hw->name, hw->id); +strscpy (hw->name, hw->id);switch (opl3->hardware &OPL3_HW_MASK ) {case OPL3_HW_OPL2 : -strcpy (hw->name,"OPL2 FM" ); +strscpy (hw->name,"OPL2 FM" ); hw->iface =SNDRV_HWDEP_IFACE_OPL2 ;break ;case OPL3_HW_OPL3 : -strcpy (hw->name,"OPL3 FM" ); +strscpy (hw->name,"OPL3 FM" ); hw->iface =SNDRV_HWDEP_IFACE_OPL3 ;break ;case OPL3_HW_OPL4 : -strcpy (hw->name,"OPL4 FM" ); +strscpy (hw->name,"OPL4 FM" ); hw->iface =SNDRV_HWDEP_IFACE_OPL4 ;break ; }
@@ -524,7 +524,7 @@ int snd_opl3_hwdep_new(struct snd_opl3 * opl3,#if IS_ENABLED (CONFIG_SND_SEQUENCER )if (snd_seq_device_new (card, seq_device,SNDRV_SEQ_DEV_ID_OPL3 ,sizeof (struct snd_opl3 *), &opl3->seq_dev) >=0 ) { -strcpy (opl3->seq_dev->name, hw->name); +strscpy (opl3->seq_dev->name, hw->name); *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR (opl3->seq_dev) = opl3; }#endif
Signature · 1 line
2.50.0
PATCH 6/103 ALSA: opl4: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/drivers/opl4/opl4_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/drivers/opl4/opl4_lib.c +1 -1
@@ -152,7 +152,7 @@ static int snd_opl4_create_seq_dev(struct snd_opl4 *opl4, int seq_device) opl4->seq_dev_num = seq_device;if (snd_seq_device_new (opl4->card, seq_device,SNDRV_SEQ_DEV_ID_OPL4 ,sizeof (struct snd_opl4 *), &opl4->seq_dev) >=0 ) { -strcpy (opl4->seq_dev->name,"OPL4 Wavetable" ); +strscpy (opl4->seq_dev->name,"OPL4 Wavetable" ); *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR (opl4->seq_dev) = opl4; opl4->seq_dev->private_data = opl4; opl4->seq_dev->private_free = snd_opl4_seq_dev_free;
Signature · 1 line
2.50.0
PATCH 7/103 ALSA: pcsp: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/drivers/pcsp/pcsp.c | 4 ++-- sound/drivers/pcsp/pcsp_lib.c | 2 +- sound/drivers/pcsp/pcsp_mixer.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
sound/drivers/pcsp/pcsp.c +2 -2
@@ -122,8 +122,8 @@ static int snd_card_pcsp_probe(int devnum, struct device *dev)if (err <0 )return err; -strcpy (card->driver,"PC-Speaker" ); -strcpy (card->shortname,"pcsp" ); +strscpy (card->driver,"PC-Speaker" ); +strscpy (card->shortname,"pcsp" );sprintf (card->longname,"Internal PC-Speaker at port 0x%x" , pcsp_chip.port);
sound/drivers/pcsp/pcsp_lib.c +1 -1
@@ -340,7 +340,7 @@ int snd_pcsp_new_pcm(struct snd_pcsp *chip) chip->pcm->private_data = chip; chip->pcm->info_flags =SNDRV_PCM_INFO_HALF_DUPLEX ; -strcpy (chip->pcm->name,"pcsp" ); +strscpy (chip->pcm->name,"pcsp" ); snd_pcm_set_managed_buffer_all(chip->pcm, SNDRV_DMA_TYPE_CONTINUOUS,
sound/drivers/pcsp/pcsp_mixer.c +1 -1
@@ -158,7 +158,7 @@ int snd_pcsp_new_mixer(struct snd_pcsp *chip, int nopcm)if (err <0 )return err; -strcpy (card->mixername,"PC-Speaker" ); +strscpy (card->mixername,"PC-Speaker" );return 0 ; }
Signature · 1 line
2.50.0
PATCH 8/103 ALSA: portman2x4: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/drivers/portman2x4.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/drivers/portman2x4.c +3 -3
@@ -549,7 +549,7 @@ static int snd_portman_rawmidi_create(struct snd_card *card)return err; rmidi->private_data = pm; -strcpy (rmidi->name,CARD_NAME ); +strscpy (rmidi->name,CARD_NAME ); rmidi->info_flags =SNDRV_RAWMIDI_INFO_OUTPUT |SNDRV_RAWMIDI_INFO_INPUT |SNDRV_RAWMIDI_INFO_DUPLEX ;
@@ -714,8 +714,8 @@ static int snd_portman_probe(struct platform_device *pdev)dev_dbg (&pdev->dev,"Cannot create card\n" );return err; } -strcpy (card->driver,DRIVER_NAME ); -strcpy (card->shortname,CARD_NAME ); +strscpy (card->driver,DRIVER_NAME ); +strscpy (card->shortname,CARD_NAME );sprintf (card->longname,"%s at 0x%lx, irq %i" , card->shortname, p->base, p->irq);
Signature · 1 line
2.50.0
PATCH 9/103 ALSA: serial-generic: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/drivers/serial-generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/drivers/serial-generic.c +2 -2
@@ -300,7 +300,7 @@ static int snd_serial_generic_rmidi(struct snd_serial_generic *drvdata, &snd_serial_generic_input);snd_rawmidi_set_ops (rrawmidi,SNDRV_RAWMIDI_STREAM_OUTPUT , &snd_serial_generic_output); -strcpy (rrawmidi->name, drvdata->card->shortname); +strscpy (rrawmidi->name, drvdata->card->shortname);snd_serial_generic_substreams (&rrawmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT ], drvdata->serdev->ctrl->nr);
@@ -329,7 +329,7 @@ static int snd_serial_generic_probe(struct serdev_device *serdev)if (err <0 )return err; -strcpy (card->driver,"SerialMIDI" ); +strscpy (card->driver,"SerialMIDI" );sprintf (card->shortname,"SerialMIDI-%d" , serdev->ctrl->nr);sprintf (card->longname,"Serial MIDI device at serial%d" , serdev->ctrl->nr);
Signature · 1 line
2.50.0
PATCH 10/103 ALSA: serial-u16550: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/drivers/serial-u16550.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/drivers/serial-u16550.c +3 -3
@@ -845,7 +845,7 @@ static int snd_uart16550_rmidi(struct snd_uart16550 *uart, int device, &snd_uart16550_input);snd_rawmidi_set_ops (rrawmidi,SNDRV_RAWMIDI_STREAM_OUTPUT , &snd_uart16550_output); -strcpy (rrawmidi->name,"Serial MIDI" ); +strscpy (rrawmidi->name,"Serial MIDI" );snd_uart16550_substreams (&rrawmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT ]);snd_uart16550_substreams (&rrawmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT ]); rrawmidi->info_flags = SNDRV_RAWMIDI_INFO_OUTPUT |
@@ -905,8 +905,8 @@ static int snd_serial_probe(struct platform_device *devptr)if (err <0 )return err; -strcpy (card->driver,"Serial" ); -strcpy (card->shortname,"Serial MIDI (UART16550A)" ); +strscpy (card->driver,"Serial" ); +strscpy (card->shortname,"Serial MIDI (UART16550A)" ); err = snd_uart16550_create(card, port[dev], irq[dev], speed[dev], base[dev], adaptor[dev], droponfull[dev],
Signature · 1 line
2.50.0
PATCH 11/103 ALSA: virmidi: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/drivers/virmidi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/drivers/virmidi.c +3 -3
@@ -95,11 +95,11 @@ static int snd_virmidi_probe(struct platform_device *devptr)if (err <0 )return err; vmidi->midi[idx] = rmidi; -strcpy (rmidi->name,"Virtual Raw MIDI" ); +strscpy (rmidi->name,"Virtual Raw MIDI" ); } -strcpy (card->driver,"VirMIDI" ); -strcpy (card->shortname,"VirMIDI" ); +strscpy (card->driver,"VirMIDI" ); +strscpy (card->shortname,"VirMIDI" );sprintf (card->longname,"Virtual MIDI Card %i" , dev +1 ); err =snd_card_register (card);
Signature · 1 line
2.50.0
PATCH 12/103 ALSA: vx: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/drivers/vx/vx_core.c | 2 +- sound/drivers/vx/vx_mixer.c | 2 +- sound/drivers/vx/vx_pcm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
sound/drivers/vx/vx_core.c +1 -1
@@ -806,7 +806,7 @@ struct vx_core *snd_vx_create(struct snd_card *card, chip->card = card; card->private_data = chip; -strcpy (card->driver, hw->name); +strscpy (card->driver, hw->name);sprintf (card->shortname,"Digigram %s" , hw->name);vx_proc_init (chip);
sound/drivers/vx/vx_mixer.c +1 -1
@@ -903,7 +903,7 @@ int snd_vx_mixer_new(struct vx_core *chip)struct snd_card *card = chip->card;char name[32 ]; -strcpy (card->mixername, card->driver); +strscpy (card->mixername, card->driver);/* output level controls */ for (i =0 ; i < chip->hw->num_outs; i++) {
sound/drivers/vx/vx_pcm.c +1 -1
@@ -1226,7 +1226,7 @@ int snd_vx_pcm_new(struct vx_core *chip) pcm->private_free = snd_vx_pcm_free; pcm->info_flags =0 ; pcm->nonatomic = true; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcm[i] = pcm; }
Signature · 1 line
2.50.0
PATCH 13/103 ALSA: firewire: bebob: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/firewire/bebob/bebob.c | 6 +++--- sound/firewire/bebob/bebob_hwdep.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
sound/firewire/bebob/bebob.c +3 -3
@@ -105,9 +105,9 @@ name_device(struct snd_bebob *bebob)if (err <0 ) goto end; -strcpy (bebob->card->driver,"BeBoB" ); -strcpy (bebob->card->shortname, model); -strcpy (bebob->card->mixername, model); +strscpy (bebob->card->driver,"BeBoB" ); +strscpy (bebob->card->shortname, model); +strscpy (bebob->card->mixername, model); snprintf(bebob->card->longname, sizeof(bebob->card->longname), "%s %s (id:%d, rev:%d), GUID %08x%08x at %s, S%d", vendor, model, hw_id, revision,
sound/firewire/bebob/bebob_hwdep.c +1 -1
@@ -183,7 +183,7 @@ int snd_bebob_create_hwdep_device(struct snd_bebob *bebob) err =snd_hwdep_new (bebob->card,"BeBoB" ,0 , &hwdep);if (err <0 ) goto end; -strcpy (hwdep->name,"BeBoB" ); +strscpy (hwdep->name,"BeBoB" ); hwdep->iface =SNDRV_HWDEP_IFACE_FW_BEBOB ; hwdep->ops = ops; hwdep->private_data = bebob;
Signature · 1 line
2.50.0
PATCH 14/103 ALSA: firewire: dice: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/firewire/dice/dice-hwdep.c | 2 +- sound/firewire/dice/dice-pcm.c | 2 +- sound/firewire/dice/dice.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-)
sound/firewire/dice/dice-hwdep.c +1 -1
@@ -179,7 +179,7 @@ int snd_dice_create_hwdep(struct snd_dice *dice) err =snd_hwdep_new (dice->card,"DICE" ,0 , &hwdep);if (err <0 )return err; -strcpy (hwdep->name,"DICE" ); +strscpy (hwdep->name,"DICE" ); hwdep->iface =SNDRV_HWDEP_IFACE_FW_DICE ; hwdep->ops = ops; hwdep->private_data = dice;
sound/firewire/dice/dice-pcm.c +1 -1
@@ -442,7 +442,7 @@ int snd_dice_create_pcm(struct snd_dice *dice)return err; pcm->private_data = dice; pcm->nonatomic = true; -strcpy (pcm->name, dice->card->shortname); +strscpy (pcm->name, dice->card->shortname);if (capture >0 ) snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
sound/firewire/dice/dice.c +5 -5
@@ -102,9 +102,9 @@ static void dice_card_strings(struct snd_dice *dice)unsigned int i;int err; -strcpy (card->driver,"DICE" ); +strscpy (card->driver,"DICE" ); -strcpy (card->shortname,"DICE" ); +strscpy (card->shortname,"DICE" );BUILD_BUG_ON (NICK_NAME_SIZE <sizeof (card->shortname)); err = snd_dice_transaction_read_global(dice, GLOBAL_NICK_NAME, card->shortname,
@@ -117,16 +117,16 @@ static void dice_card_strings(struct snd_dice *dice) card->shortname[sizeof (card->shortname) -1 ] ='\0' ; } -strcpy (vendor,"?" ); +strscpy (vendor,"?" );fw_csr_string (dev->config_rom +5 ,CSR_VENDOR , vendor,sizeof (vendor)); -strcpy (model,"?" ); +strscpy (model,"?" );fw_csr_string (dice->unit->directory,CSR_MODEL , model,sizeof (model));snprintf (card->longname,sizeof (card->longname),"%s %s (serial %u) at %s, S%d" , vendor, model, dev->config_rom[4 ] &0x3fffff ,dev_name (&dice->unit->device),100 << dev->max_speed); -strcpy (card->mixername,"DICE" ); +strscpy (card->mixername,"DICE" ); }static void dice_card_free (struct snd_card *card)
Signature · 1 line
2.50.0
PATCH 15/103 ALSA: firewire: digi00x: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/firewire/digi00x/digi00x-hwdep.c | 2 +- sound/firewire/digi00x/digi00x.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
sound/firewire/digi00x/digi00x-hwdep.c +1 -1
@@ -188,7 +188,7 @@ int snd_dg00x_create_hwdep_device(struct snd_dg00x *dg00x)if (err <0 )return err; -strcpy (hwdep->name,"Digi00x" ); +strscpy (hwdep->name,"Digi00x" ); hwdep->iface =SNDRV_HWDEP_IFACE_FW_DIGI00X ; hwdep->ops = ops; hwdep->private_data = dg00x;
sound/firewire/digi00x/digi00x.c +3 -3
@@ -30,9 +30,9 @@ static int name_card(struct snd_dg00x *dg00x) model =skip_spaces (name); -strcpy (dg00x->card->driver,"Digi00x" ); -strcpy (dg00x->card->shortname, model); -strcpy (dg00x->card->mixername, model); +strscpy (dg00x->card->driver,"Digi00x" ); +strscpy (dg00x->card->shortname, model); +strscpy (dg00x->card->mixername, model); snprintf(dg00x->card->longname, sizeof(dg00x->card->longname), "Digidesign %s, GUID %08x%08x at %s, S%d", model, fw_dev->config_rom[3], fw_dev->config_rom[4],
Signature · 1 line
2.50.0
PATCH 16/103 ALSA: firewire: fireface: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/firewire/fireface/ff-hwdep.c | 2 +- sound/firewire/fireface/ff.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
sound/firewire/fireface/ff-hwdep.c +1 -1
@@ -197,7 +197,7 @@ int snd_ff_create_hwdep_devices(struct snd_ff *ff)if (err <0 )return err; -strcpy (hwdep->name, ff->card->driver); +strscpy (hwdep->name, ff->card->driver); hwdep->iface =SNDRV_HWDEP_IFACE_FW_FIREFACE ; hwdep->ops = hwdep_ops; hwdep->private_data = ff;
sound/firewire/fireface/ff.c +3 -3
@@ -27,9 +27,9 @@ static void name_card(struct snd_ff *ff) name = names[ff->unit_version]; -strcpy (ff->card->driver,"Fireface" ); -strcpy (ff->card->shortname, name); -strcpy (ff->card->mixername, name); +strscpy (ff->card->driver,"Fireface" ); +strscpy (ff->card->shortname, name); +strscpy (ff->card->mixername, name); snprintf(ff->card->longname, sizeof(ff->card->longname), "RME %s, GUID %08x%08x at %s, S%d", name, fw_dev->config_rom[3], fw_dev->config_rom[4],
Signature · 1 line
2.50.0
PATCH 17/103 ALSA: firewire: fireworks: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/firewire/fireworks/fireworks.c | 6 +++--- sound/firewire/fireworks/fireworks_hwdep.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
sound/firewire/fireworks/fireworks.c +3 -3
@@ -90,9 +90,9 @@ get_hardware_info(struct snd_efw *efw) (hwinfo->arm_version >> 16) & 0xff); efw->firmware_version = hwinfo->arm_version; -strcpy (efw->card->driver,"Fireworks" ); -strcpy (efw->card->shortname, hwinfo->model_name); -strcpy (efw->card->mixername, hwinfo->model_name); +strscpy (efw->card->driver,"Fireworks" ); +strscpy (efw->card->shortname, hwinfo->model_name); +strscpy (efw->card->mixername, hwinfo->model_name); scnprintf(efw->card->longname, sizeof(efw->card->longname), "%s %s v%s, GUID %08x%08x at %s, S%d", hwinfo->vendor_name, hwinfo->model_name, version,
sound/firewire/fireworks/fireworks_hwdep.c +1 -1
@@ -319,7 +319,7 @@ int snd_efw_create_hwdep_device(struct snd_efw *efw) err =snd_hwdep_new (efw->card,"Fireworks" ,0 , &hwdep);if (err <0 ) goto end; -strcpy (hwdep->name,"Fireworks" ); +strscpy (hwdep->name,"Fireworks" ); hwdep->iface =SNDRV_HWDEP_IFACE_FW_FIREWORKS ; hwdep->ops = ops; hwdep->private_data = efw;
Signature · 1 line
2.50.0
PATCH 18/103 ALSA: firewire: isight: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/firewire/isight.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/firewire/isight.c +4 -4
@@ -455,7 +455,7 @@ static int isight_create_pcm(struct isight *isight)return err; pcm->private_data = isight; pcm->nonatomic = true; -strcpy (pcm->name,"iSight" ); +strscpy (pcm->name,"iSight" ); isight->pcm = pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream; isight->pcm->ops = &ops;snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_VMALLOC ,NULL ,0 ,0 );
@@ -638,13 +638,13 @@ static int isight_probe(struct fw_unit *unit, card->private_free = isight_card_free; -strcpy (card->driver,"iSight" ); -strcpy (card->shortname,"Apple iSight" ); +strscpy (card->driver,"iSight" ); +strscpy (card->shortname,"Apple iSight" );snprintf (card->longname,sizeof (card->longname),"Apple iSight (GUID %08x%08x) at %s, S%d" , fw_dev->config_rom[3 ], fw_dev->config_rom[4 ],dev_name (&unit->device),100 << fw_dev->max_speed); -strcpy (card->mixername,"iSight" ); +strscpy (card->mixername,"iSight" ); err =isight_create_pcm (isight);if (err <0 )
Signature · 1 line
2.50.0
PATCH 19/103 ALSA: firewire: motu: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/firewire/motu/motu-hwdep.c | 2 +- sound/firewire/motu/motu-pcm.c | 2 +- sound/firewire/motu/motu.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
sound/firewire/motu/motu-hwdep.c +1 -1
@@ -290,7 +290,7 @@ int snd_motu_create_hwdep_device(struct snd_motu *motu)if (err <0 )return err; -strcpy (hwdep->name,"MOTU" ); +strscpy (hwdep->name,"MOTU" ); hwdep->iface =SNDRV_HWDEP_IFACE_FW_MOTU ; hwdep->ops = ops; hwdep->private_data = motu;
sound/firewire/motu/motu-pcm.c +1 -1
@@ -361,7 +361,7 @@ int snd_motu_create_pcm_devices(struct snd_motu *motu)return err; pcm->private_data = motu; pcm->nonatomic = true; -strcpy (pcm->name, motu->card->shortname); +strscpy (pcm->name, motu->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &capture_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_ops);
sound/firewire/motu/motu.c +3 -3
@@ -41,9 +41,9 @@ static void name_card(struct snd_motu *motu) } } -strcpy (motu->card->driver,"FW-MOTU" ); -strcpy (motu->card->shortname, motu->spec->name); -strcpy (motu->card->mixername, motu->spec->name); +strscpy (motu->card->driver,"FW-MOTU" ); +strscpy (motu->card->shortname, motu->spec->name); +strscpy (motu->card->mixername, motu->spec->name); snprintf(motu->card->longname, sizeof(motu->card->longname), "MOTU %s (version:%06x), GUID %08x%08x at %s, S%d", motu->spec->name, version,
Signature · 1 line
2.50.0
PATCH 20/103 ALSA: firewire: oxfw: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/firewire/oxfw/oxfw-hwdep.c | 2 +- sound/firewire/oxfw/oxfw-pcm.c | 2 +- sound/firewire/oxfw/oxfw.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
sound/firewire/oxfw/oxfw-hwdep.c +1 -1
@@ -177,7 +177,7 @@ int snd_oxfw_create_hwdep(struct snd_oxfw *oxfw) err =snd_hwdep_new (oxfw->card, oxfw->card->driver,0 , &hwdep);if (err <0 ) goto end; -strcpy (hwdep->name, oxfw->card->driver); +strscpy (hwdep->name, oxfw->card->driver); hwdep->iface =SNDRV_HWDEP_IFACE_FW_OXFW ; hwdep->ops = hwdep_ops; hwdep->private_data = oxfw;
sound/firewire/oxfw/oxfw-pcm.c +1 -1
@@ -441,7 +441,7 @@ int snd_oxfw_create_pcm(struct snd_oxfw *oxfw) pcm->private_data = oxfw; pcm->nonatomic = true; -strcpy (pcm->name, oxfw->card->shortname); +strscpy (pcm->name, oxfw->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_ops);if (cap >0 )snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &capture_ops);
sound/firewire/oxfw/oxfw.c +3 -3
@@ -105,9 +105,9 @@ static int name_card(struct snd_oxfw *oxfw, const struct ieee1394_device_id *ent m = model; } -strcpy (oxfw->card->driver, d); -strcpy (oxfw->card->mixername, m); -strcpy (oxfw->card->shortname, m); +strscpy (oxfw->card->driver, d); +strscpy (oxfw->card->mixername, m); +strscpy (oxfw->card->shortname, m); scnprintf(oxfw->card->longname, sizeof(oxfw->card->longname), "%s %s (OXFW%x %04x), GUID %08x%08x at %s, S%d",
Signature · 1 line
2.50.0
PATCH 21/103 ALSA: firewire: tascam: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/firewire/tascam/tascam-hwdep.c | 2 +- sound/firewire/tascam/tascam.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
sound/firewire/tascam/tascam-hwdep.c +1 -1
@@ -265,7 +265,7 @@ int snd_tscm_create_hwdep_device(struct snd_tscm *tscm)if (err <0 )return err; -strcpy (hwdep->name,"Tascam" ); +strscpy (hwdep->name,"Tascam" ); hwdep->iface =SNDRV_HWDEP_IFACE_FW_TASCAM ; hwdep->ops = ops; hwdep->private_data = tscm;
sound/firewire/tascam/tascam.c +3 -3
@@ -73,9 +73,9 @@ static int identify_model(struct snd_tscm *tscm)if (tscm->spec ==NULL )return -ENODEV ; -strcpy (tscm->card->driver,"FW-TASCAM" ); -strcpy (tscm->card->shortname, model); -strcpy (tscm->card->mixername, model); +strscpy (tscm->card->driver,"FW-TASCAM" ); +strscpy (tscm->card->shortname, model); +strscpy (tscm->card->mixername, model); snprintf(tscm->card->longname, sizeof(tscm->card->longname), "TASCAM %s, GUID %08x%08x at %s, S%d", model, fw_dev->config_rom[3], fw_dev->config_rom[4],
Signature · 1 line
2.50.0
PATCH 22/103 ALSA: ad1816a: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/ad1816a/ad1816a.c | 4 ++-- sound/isa/ad1816a/ad1816a_lib.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
sound/isa/ad1816a/ad1816a.c +2 -2
@@ -143,8 +143,8 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard,if (clockfreq[dev] >=5000 && clockfreq[dev] <=100000 ) chip->clock_freq = clockfreq[dev]; -strcpy (card->driver,"AD1816A" ); -strcpy (card->shortname,"ADI SoundPort AD1816A" ); +strscpy (card->driver,"AD1816A" ); +strscpy (card->shortname,"ADI SoundPort AD1816A" );sprintf (card->longname,"%s, SS at 0x%lx, irq %d, dma %d&%d" , card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]);
sound/isa/ad1816a/ad1816a_lib.c +3 -3
@@ -631,7 +631,7 @@ int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device) pcm->private_data = chip; pcm->info_flags = (chip->dma1 == chip->dma2 ) ?SNDRV_PCM_INFO_JOINT_DUPLEX :0 ; -strcpy (pcm->name,snd_ad1816a_chip_id (chip)); +strscpy (pcm->name,snd_ad1816a_chip_id (chip));snd_ad1816a_init (chip); snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, chip->card->dev,
@@ -655,7 +655,7 @@ int snd_ad1816a_timer(struct snd_ad1816a *chip, int device) error =snd_timer_new (chip->card,"AD1816A" , &tid, &timer);if (error <0 )return error; -strcpy (timer->name,snd_ad1816a_chip_id (chip)); +strscpy (timer->name,snd_ad1816a_chip_id (chip)); timer->private_data = chip; chip->timer = timer; timer->hw = snd_ad1816a_timer_table;
@@ -912,7 +912,7 @@ int snd_ad1816a_mixer(struct snd_ad1816a *chip) card = chip->card; -strcpy (card->mixername,snd_ad1816a_chip_id (chip)); +strscpy (card->mixername,snd_ad1816a_chip_id (chip));for (idx =0 ; idx <ARRAY_SIZE (snd_ad1816a_controls); idx++) { err =snd_ctl_add (card,snd_ctl_new1 (&snd_ad1816a_controls[idx], chip));
Signature · 1 line
2.50.0
PATCH 23/103 ALSA: adlib: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/adlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/adlib.c +2 -2
@@ -61,8 +61,8 @@ static int snd_adlib_probe(struct device *dev, unsigned int n)return -EBUSY ; } -strcpy (card->driver,DEV_NAME ); -strcpy (card->shortname,CRD_NAME ); +strscpy (card->driver,DEV_NAME ); +strscpy (card->shortname,CRD_NAME );sprintf (card->longname,CRD_NAME " at %#lx" , port[n]); error =snd_opl3_create (card, port[n], port[n] +2 ,OPL3_HW_AUTO ,1 , &opl3);
Signature · 1 line
2.50.0
PATCH 24/103 ALSA: als100: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/als100.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/isa/als100.c +4 -4
@@ -192,14 +192,14 @@ static int snd_card_als100_probe(int dev, acard->chip = chip;if (pid->driver_data ==SB_HW_DT019X ) { -strcpy (card->driver,"DT-019X" ); -strcpy (card->shortname,"Diamond Tech. DT-019X" ); +strscpy (card->driver,"DT-019X" ); +strscpy (card->shortname,"Diamond Tech. DT-019X" );snprintf (card->longname,sizeof (card->longname),"Diamond Tech. DT-019X, %s at 0x%lx, irq %d, dma %d" , chip->name, chip->port, irq[dev], dma8[dev]); }else { -strcpy (card->driver,"ALS100" ); -strcpy (card->shortname,"Avance Logic ALS100" ); +strscpy (card->driver,"ALS100" ); +strscpy (card->shortname,"Avance Logic ALS100" ); snprintf(card->longname, sizeof(card->longname), "Avance Logic ALS100, %s at 0x%lx, irq %d, dma %d&%d", chip->name, chip->port, irq[dev], dma8[dev],
Signature · 1 line
2.50.0
PATCH 25/103 ALSA: cmi8328: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/cmi8328.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
sound/isa/cmi8328.c +10 -10
@@ -155,34 +155,34 @@ static int snd_cmi8328_mixer(struct snd_wss *chip)memset (&id2,0 ,sizeof (id2)); id1.iface = id2.iface =SNDRV_CTL_ELEM_IFACE_MIXER ;/* rename AUX0 switch to CD */ -strcpy (id1.name,"Aux Playback Switch" ); -strcpy (id2.name,"CD Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); +strscpy (id2.name,"CD Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 ) {dev_err (card->dev,"error renaming control\n" );return err; }/* rename AUX0 volume to CD */ -strcpy (id1.name,"Aux Playback Volume" ); -strcpy (id2.name,"CD Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); +strscpy (id2.name,"CD Playback Volume" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 ) {dev_err (card->dev,"error renaming control\n" );return err; }/* rename AUX1 switch to Synth */ -strcpy (id1.name,"Aux Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; -strcpy (id2.name,"Synth Playback Switch" ); +strscpy (id2.name,"Synth Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 ) {dev_err (card->dev,"error renaming control\n" );return err; }/* rename AUX1 volume to Synth */ -strcpy (id1.name,"Aux Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); id1.index =1 ; -strcpy (id2.name,"Synth Playback Volume" ); +strscpy (id2.name,"Synth Playback Volume" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 ) {dev_err (card->dev,"error renaming control\n" );
@@ -362,8 +362,8 @@ static int snd_cmi8328_probe(struct device *pdev, unsigned int ndev)if (snd_opl3_hwdep_new (opl3,0 ,1 ,NULL ) <0 )dev_warn (pdev,"error initializing OPL3 hwdep\n" ); -strcpy (card->driver,"CMI8328" ); -strcpy (card->shortname,"C-Media CMI8328" ); +strscpy (card->driver,"CMI8328" ); +strscpy (card->shortname,"C-Media CMI8328" );sprintf (card->longname,"%s at 0x%lx, irq %d, dma %d,%d" , card->shortname, cmi->wss->port, irq[ndev], dma1[ndev], (dma2[ndev] >=0 ) ? dma2[ndev] : dma1[ndev]);
Signature · 1 line
2.50.0
PATCH 26/103 ALSA: cmi8330: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/cmi8330.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/isa/cmi8330.c +4 -4
@@ -297,7 +297,7 @@ static int snd_cmi8330_mixer(struct snd_card *card, struct snd_cmi8330 *acard)unsigned int idx;int err; -strcpy (card->mixername, (acard->type ==CMI8329 ) ?"CMI8329" :"CMI8330/C3D" ); +strscpy (card->mixername, (acard->type ==CMI8329 ) ?"CMI8329" :"CMI8330/C3D" );for (idx =0 ; idx <ARRAY_SIZE (snd_cmi8330_controls); idx++) { err = snd_ctl_add(card,
@@ -437,7 +437,7 @@ static int snd_cmi8330_pcm(struct snd_card *card, struct snd_cmi8330 *chip) err =snd_pcm_new (card, (chip->type ==CMI8329 ) ?"CMI8329" :"CMI8330" ,0 ,1 ,1 , &pcm);if (err <0 )return err; -strcpy (pcm->name, (chip->type ==CMI8329 ) ?"CMI8329" :"CMI8330" ); +strscpy (pcm->name, (chip->type ==CMI8329 ) ?"CMI8329" :"CMI8330" ); pcm->private_data = chip;/* SB16 */
@@ -590,8 +590,8 @@ static int snd_cmi8330_probe(struct snd_card *card, int dev) mpuport[dev]); } -strcpy (card->driver, (acard->type ==CMI8329 ) ?"CMI8329" :"CMI8330/C3D" ); -strcpy (card->shortname, (acard->type ==CMI8329 ) ?"C-Media CMI8329" :"C-Media CMI8330/C3D" ); +strscpy (card->driver, (acard->type ==CMI8329 ) ?"CMI8329" :"CMI8330/C3D" ); +strscpy (card->shortname, (acard->type ==CMI8329 ) ?"C-Media CMI8329" :"C-Media CMI8330/C3D" ); sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d", card->shortname, acard->wss->port,
Signature · 1 line
2.50.0
PATCH 27/103 ALSA: cs423x: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/cs423x/cs4236.c | 2 +- sound/isa/cs423x/cs4236_lib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/isa/cs423x/cs4236.c +1 -1
@@ -510,7 +510,7 @@ static int snd_cs423x_pnpbios_detect(struct pnp_dev *pdev,return -ENODEV ;/* prepare second id */ -strcpy (cid, pdev->id[0 ].id); +strscpy (cid, pdev->id[0 ].id); cid[5 ] ='1' ; cdev =NULL ;list_for_each_entry (iter, &(pdev->protocol->devices), protocol_list) {
sound/isa/cs423x/cs4236_lib.c +1 -1
@@ -1023,7 +1023,7 @@ int snd_cs4236_mixer(struct snd_wss *chip)if (snd_BUG_ON (!chip || !chip->card))return -EINVAL ; card = chip->card; -strcpy (card->mixername,snd_wss_chip_id (chip)); +strscpy (card->mixername,snd_wss_chip_id (chip));if (chip->hardware ==WSS_HW_CS4235 || chip->hardware ==WSS_HW_CS4239 ) {
Signature · 1 line
2.50.0
Re: [PATCH 027/103] ALSA: cs423x: Use safer strscpy() instead of strcpy()
Quoted 7 lines · Takashi Iwai
Use a safer function
strscpy()instead ofstrcpy()for copying to arrays.Only idiomatic code replacement, and no functional changes.
Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 28/103 ALSA: es1688: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/es1688/es1688_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/es1688/es1688_lib.c +2 -2
@@ -706,7 +706,7 @@ int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device) pcm->private_data = chip; pcm->info_flags =SNDRV_PCM_INFO_HALF_DUPLEX ; -strcpy (pcm->name,snd_es1688_chip_id (chip)); +strscpy (pcm->name,snd_es1688_chip_id (chip)); chip->pcm = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, card->dev,
@@ -971,7 +971,7 @@ int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip)if (snd_BUG_ON (!chip || !card))return -EINVAL ; -strcpy (card->mixername,snd_es1688_chip_id (chip)); +strscpy (card->mixername,snd_es1688_chip_id (chip));for (idx =0 ; idx <ARRAY_SIZE (snd_es1688_controls); idx++) { err =snd_ctl_add (card,snd_ctl_new1 (&snd_es1688_controls[idx], chip));
Signature · 1 line
2.50.0
PATCH 29/103 ALSA: es18xx: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/es18xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/isa/es18xx.c +1 -1
@@ -1771,7 +1771,7 @@ static int snd_es18xx_mixer(struct snd_card *card)int err;unsigned int idx; -strcpy (card->mixername, chip->pcm->name); +strscpy (card->mixername, chip->pcm->name);for (idx =0 ; idx <ARRAY_SIZE (snd_es18xx_base_controls); idx++) {struct snd_kcontrol *kctl;
Signature · 1 line
2.50.0
PATCH 30/103 ALSA: galaxy: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/galaxy/galaxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/galaxy/galaxy.c +2 -2
@@ -542,8 +542,8 @@ static int __snd_galaxy_probe(struct device *dev, unsigned int n)return err; } -strcpy (card->driver,DRV_NAME ); -strcpy (card->shortname,DRV_NAME ); +strscpy (card->driver,DRV_NAME ); +strscpy (card->shortname,DRV_NAME );sprintf (card->longname,"%s at %#lx/%#lx, irq %d, dma %d/%d" , card->shortname, port[n], wss_port[n], irq[n], dma1[n], dma2[n]);
Signature · 1 line
2.50.0
PATCH 31/103 ALSA: gus: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/gus/gus_main.c | 16 ++++++++-------- sound/isa/gus/gus_mixer.c | 2 +- sound/isa/gus/gus_pcm.c | 2 +- sound/isa/gus/gus_timer.c | 4 ++-- sound/isa/gus/gus_uart.c | 2 +- sound/isa/gus/gusextreme.c | 8 ++++---- sound/isa/gus/gusmax.c | 16 ++++++++-------- sound/isa/gus/interwave.c | 34 +++++++++++++++++----------------- 8 files changed, 42 insertions(+), 42 deletions(-)
sound/isa/gus/gus_main.c +8 -8
@@ -348,8 +348,8 @@ static int snd_gus_check_version(struct snd_gus_card * gus) rev =inb (GUSP (gus,BOARDVERSION ));spin_unlock_irqrestore (&gus->reg_lock, flags);dev_dbg (card->dev,"GF1 [0x%lx] init - val = 0x%x, rev = 0x%x\n" , gus->gf1.port, val, rev); -strcpy (card->driver,"GUS" ); -strcpy (card->longname,"Gravis UltraSound Classic (2.4)" ); +strscpy (card->driver,"GUS" ); +strscpy (card->longname,"Gravis UltraSound Classic (2.4)" );if ((val !=255 && (val &0x06 )) || (rev >=5 && rev !=255 )) {if (rev >=5 && rev <=9 ) { gus->ics_flag =1 ;
@@ -360,16 +360,16 @@ static int snd_gus_check_version(struct snd_gus_card * gus) }if (rev >=10 && rev !=255 ) {if (rev >=10 && rev <=11 ) { -strcpy (card->driver,"GUS MAX" ); -strcpy (card->longname,"Gravis UltraSound MAX" ); +strscpy (card->driver,"GUS MAX" ); +strscpy (card->longname,"Gravis UltraSound MAX" ); gus->max_flag =1 ; }else if (rev ==0x30 ) { -strcpy (card->driver,"GUS ACE" ); -strcpy (card->longname,"Gravis UltraSound Ace" ); +strscpy (card->driver,"GUS ACE" ); +strscpy (card->longname,"Gravis UltraSound Ace" ); gus->ace_flag =1 ; }else if (rev ==0x50 ) { -strcpy (card->driver,"GUS Extreme" ); -strcpy (card->longname,"Gravis UltraSound Extreme" ); +strscpy (card->driver,"GUS Extreme" ); +strscpy (card->longname,"Gravis UltraSound Extreme" ); gus->ess_flag =1 ; }else { dev_err(card->dev,
sound/isa/gus/gus_mixer.c +1 -1
@@ -152,7 +152,7 @@ int snd_gf1_new_mixer(struct snd_gus_card * gus)if (gus->ics_flag)snd_component_add (card,"ICS2101" );if (card->mixername[0 ] =='\0' ) { -strcpy (card->mixername, gus->ics_flag ?"GF1,ICS2101" :"GF1" ); +strscpy (card->mixername, gus->ics_flag ?"GF1,ICS2101" :"GF1" ); }else {if (gus->ics_flag)strcat (card->mixername,",ICS2101" );
sound/isa/gus/gus_pcm.c +1 -1
@@ -851,7 +851,7 @@ int snd_gf1_pcm_new(struct snd_gus_card *gus, int pcm_dev, int control_index)SNDRV_DMA_TYPE_DEV , card->dev, 64*1024, gus->gf1.dma2 > 3 ? 128*1024 : 64*1024); } -strcpy (pcm->name, pcm->id); +strscpy (pcm->name, pcm->id);if (gus->interwave) {sprintf (pcm->name +strlen (pcm->name)," rev %c" , gus->revision +'A' ); }
sound/isa/gus/gus_timer.c +2 -2
@@ -156,7 +156,7 @@ void snd_gf1_timers_init(struct snd_gus_card * gus) tid.subdevice =0 ;if (snd_timer_new (gus->card,"GF1 timer" , &tid, &timer) >=0 ) { -strcpy (timer->name,"GF1 timer #1" ); +strscpy (timer->name,"GF1 timer #1" ); timer->private_data = gus; timer->private_free = snd_gf1_timer1_free; timer->hw = snd_gf1_timer1;
@@ -166,7 +166,7 @@ void snd_gf1_timers_init(struct snd_gus_card * gus) tid.device++;if (snd_timer_new (gus->card,"GF1 timer" , &tid, &timer) >=0 ) { -strcpy (timer->name,"GF1 timer #2" ); +strscpy (timer->name,"GF1 timer #2" ); timer->private_data = gus; timer->private_free = snd_gf1_timer2_free; timer->hw = snd_gf1_timer2;
sound/isa/gus/gus_uart.c +1 -1
@@ -236,7 +236,7 @@ int snd_gf1_rawmidi_new(struct snd_gus_card *gus, int device) err =snd_rawmidi_new (gus->card,"GF1" , device,1 ,1 , &rmidi);if (err <0 )return err; -strcpy (rmidi->name, gus->interwave ?"AMD InterWave" :"GF1" ); +strscpy (rmidi->name, gus->interwave ?"AMD InterWave" :"GF1" );snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_OUTPUT , &snd_gf1_uart_output);snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_INPUT , &snd_gf1_uart_input); rmidi->info_flags |=SNDRV_RAWMIDI_INFO_OUTPUT |SNDRV_RAWMIDI_INFO_INPUT |SNDRV_RAWMIDI_INFO_DUPLEX ;
sound/isa/gus/gusextreme.c +4 -4
@@ -204,15 +204,15 @@ static int snd_gusextreme_mixer(struct snd_card *card) id1.iface = id2.iface =SNDRV_CTL_ELEM_IFACE_MIXER ;/* reassign AUX to SYNTHESIZER */ -strcpy (id1.name,"Aux Playback Volume" ); -strcpy (id2.name,"Synth Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); +strscpy (id2.name,"Synth Playback Volume" ); error =snd_ctl_rename_id (card, &id1, &id2);if (error <0 )return error;/* reassign Master Playback Switch to Synth Playback Switch */ -strcpy (id1.name,"Master Playback Switch" ); -strcpy (id2.name,"Synth Playback Switch" ); +strscpy (id1.name,"Master Playback Switch" ); +strscpy (id2.name,"Synth Playback Switch" ); error =snd_ctl_rename_id (card, &id1, &id2);if (error <0 )return error;
sound/isa/gus/gusmax.c +8 -8
@@ -134,24 +134,24 @@ static int snd_gusmax_mixer(struct snd_wss *chip)memset (&id2,0 ,sizeof (id2)); id1.iface = id2.iface =SNDRV_CTL_ELEM_IFACE_MIXER ;/* reassign AUXA to SYNTHESIZER */ -strcpy (id1.name,"Aux Playback Switch" ); -strcpy (id2.name,"Synth Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); +strscpy (id2.name,"Synth Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err; -strcpy (id1.name,"Aux Playback Volume" ); -strcpy (id2.name,"Synth Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); +strscpy (id2.name,"Synth Playback Volume" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err;/* reassign AUXB to CD */ -strcpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; -strcpy (id2.name,"CD Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; +strscpy (id2.name,"CD Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err; -strcpy (id1.name,"Aux Playback Volume" ); -strcpy (id2.name,"CD Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); +strscpy (id2.name,"CD Playback Volume" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err;
sound/isa/gus/interwave.c +17 -17
@@ -271,7 +271,7 @@ static int snd_interwave_detect(struct snd_interwave *iwcard,dev_dbg (gus->card->dev,"[0x%lx] InterWave check - passed\n" , gus->gf1.port); gus->interwave =1 ; -strcpy (gus->card->shortname,"AMD InterWave" ); +strscpy (gus->card->shortname,"AMD InterWave" ); gus->revision = rev1 >>4 ;#ifndef SNDRV_STB return 0 ;/* ok.. We have an InterWave board */
@@ -500,11 +500,11 @@ static int snd_interwave_mixer(struct snd_wss *chip) id1.iface = id2.iface =SNDRV_CTL_ELEM_IFACE_MIXER ;#if 0 /* remove mono microphone controls */ -strcpy (id1.name,"Mic Playback Switch" ); +strscpy (id1.name,"Mic Playback Switch" ); err =snd_ctl_remove_id (card, &id1);if (err <0 )return err; -strcpy (id1.name,"Mic Playback Volume" ); +strscpy (id1.name,"Mic Playback Volume" ); err =snd_ctl_remove_id (card, &id1);if (err <0 )return err;
@@ -520,24 +520,24 @@ static int snd_interwave_mixer(struct snd_wss *chip)snd_wss_out (chip,CS4231_LEFT_MIC_INPUT ,0x9f );snd_wss_out (chip,CS4231_RIGHT_MIC_INPUT ,0x9f );/* reassign AUXA to SYNTHESIZER */ -strcpy (id1.name,"Aux Playback Switch" ); -strcpy (id2.name,"Synth Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); +strscpy (id2.name,"Synth Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err; -strcpy (id1.name,"Aux Playback Volume" ); -strcpy (id2.name,"Synth Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); +strscpy (id2.name,"Synth Playback Volume" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err;/* reassign AUXB to CD */ -strcpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; -strcpy (id2.name,"CD Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; +strscpy (id2.name,"CD Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err; -strcpy (id1.name,"Aux Playback Volume" ); -strcpy (id2.name,"CD Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); +strscpy (id2.name,"CD Playback Volume" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err;
@@ -713,14 +713,14 @@ static int snd_interwave_probe(struct snd_card *card, int dev,memset (&id1,0 ,sizeof (id1));memset (&id2,0 ,sizeof (id2)); id1.iface = id2.iface =SNDRV_CTL_ELEM_IFACE_MIXER ; -strcpy (id1.name,"Master Playback Switch" ); -strcpy (id2.name, id1.name); +strscpy (id1.name,"Master Playback Switch" ); +strscpy (id2.name, id1.name); id2.index =1 ; err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err; -strcpy (id1.name,"Master Playback Volume" ); -strcpy (id2.name, id1.name); +strscpy (id1.name,"Master Playback Volume" ); +strscpy (id2.name, id1.name); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err;
@@ -742,8 +742,8 @@ static int snd_interwave_probe(struct snd_card *card, int dev,#else str ="InterWave STB" ;#endif -strcpy (card->driver, str); -strcpy (card->shortname, str); +strscpy (card->driver, str); +strscpy (card->shortname, str); sprintf(card->longname, "%s at 0x%lx, irq %i, dma %d", str, gus->gf1.port,
Signature · 1 line
2.50.0
PATCH 32/103 ALSA: msnd: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/msnd/msnd.c | 2 +- sound/isa/msnd/msnd_pinnacle.c | 22 +++++++++++----------- sound/isa/msnd/msnd_pinnacle_mixer.c | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-)
sound/isa/msnd/msnd.c +1 -1
@@ -673,7 +673,7 @@ int snd_msnd_pcm(struct snd_card *card, int device)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_msnd_capture_ops); pcm->private_data = chip; -strcpy (pcm->name,"Hurricane" ); +strscpy (pcm->name,"Hurricane" );return 0 ; }
sound/isa/msnd/msnd_pinnacle.c +11 -11
@@ -221,8 +221,8 @@ static int snd_msnd_probe(struct snd_card *card) }#ifdef MSND_CLASSIC -strcpy (card->shortname,"Classic/Tahiti/Monterey" ); -strcpy (card->longname,"Turtle Beach Multisound" ); +strscpy (card->shortname,"Classic/Tahiti/Monterey" ); +strscpy (card->longname,"Turtle Beach Multisound" ); dev_info(card->dev, LOGNAME ": %s, " "I/O 0x%lx-0x%lx, IRQ %d, memory mapped to 0x%lX-0x%lX\n", card->shortname,
@@ -251,38 +251,38 @@ static int snd_msnd_probe(struct snd_card *card)switch (info &0x7 ) {case 0x0 : rev ="I" ; -strcpy (card->shortname, pin); +strscpy (card->shortname, pin);break ;case 0x1 : rev ="F" ; -strcpy (card->shortname, pin); +strscpy (card->shortname, pin);break ;case 0x2 : rev ="G" ; -strcpy (card->shortname, pin); +strscpy (card->shortname, pin);break ;case 0x3 : rev ="H" ; -strcpy (card->shortname, pin); +strscpy (card->shortname, pin);break ;case 0x4 : rev ="E" ; -strcpy (card->shortname, fiji); +strscpy (card->shortname, fiji);break ;case 0x5 : rev ="C" ; -strcpy (card->shortname, fiji); +strscpy (card->shortname, fiji);break ;case 0x6 : rev ="D" ; -strcpy (card->shortname, fiji); +strscpy (card->shortname, fiji);break ;case 0x7 : rev ="A-B (Fiji) or A-E (Pinnacle)" ; -strcpy (card->shortname, pinfiji); +strscpy (card->shortname, pinfiji);break ; } -strcpy (card->longname,"Turtle Beach Multisound Pinnacle" ); +strscpy (card->longname,"Turtle Beach Multisound Pinnacle" ); dev_info(card->dev, LOGNAME ": %s revision %s, Xilinx version %s, " "I/O 0x%lx-0x%lx, IRQ %d, memory mapped to 0x%lX-0x%lX\n", card->shortname,
sound/isa/msnd/msnd_pinnacle_mixer.c +1 -1
@@ -299,7 +299,7 @@ int snd_msndmix_new(struct snd_card *card)if (snd_BUG_ON (!chip))return -EINVAL ;spin_lock_init (&chip->mixer_lock); -strcpy (card->mixername,"MSND Pinnacle Mixer" ); +strscpy (card->mixername,"MSND Pinnacle Mixer" );for (idx =0 ; idx <ARRAY_SIZE (snd_msnd_controls); idx++) { err = snd_ctl_add(card,
Signature · 1 line
2.50.0
PATCH 33/103 ALSA: opl3sa2: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/opl3sa2.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
sound/isa/opl3sa2.c +10 -10
@@ -488,30 +488,30 @@ static int snd_opl3sa2_mixer(struct snd_card *card)memset (&id2,0 ,sizeof (id2)); id1.iface = id2.iface =SNDRV_CTL_ELEM_IFACE_MIXER ;/* reassign AUX0 to CD */ -strcpy (id1.name,"Aux Playback Switch" ); -strcpy (id2.name,"CD Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); +strscpy (id2.name,"CD Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 ) {dev_err (card->dev,"Cannot rename opl3sa2 control\n" );return err; } -strcpy (id1.name,"Aux Playback Volume" ); -strcpy (id2.name,"CD Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); +strscpy (id2.name,"CD Playback Volume" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 ) {dev_err (card->dev,"Cannot rename opl3sa2 control\n" );return err; }/* reassign AUX1 to FM */ -strcpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; -strcpy (id2.name,"FM Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; +strscpy (id2.name,"FM Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 ) {dev_err (card->dev,"Cannot rename opl3sa2 control\n" );return err; } -strcpy (id1.name,"Aux Playback Volume" ); -strcpy (id2.name,"FM Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); +strscpy (id2.name,"FM Playback Volume" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 ) {dev_err (card->dev,"Cannot rename opl3sa2 control\n" );
@@ -618,8 +618,8 @@ static int snd_opl3sa2_card_new(struct device *pdev, int dev, sizeof(struct snd_opl3sa2), &card);if (err <0 )return err; -strcpy (card->driver,"OPL3SA2" ); -strcpy (card->shortname,"Yamaha OPL3-SA" ); +strscpy (card->driver,"OPL3SA2" ); +strscpy (card->shortname,"Yamaha OPL3-SA" ); chip = card->private_data;spin_lock_init (&chip->reg_lock); chip->irq =-1 ;
Signature · 1 line
2.50.0
PATCH 34/103 ALSA: opti9xx: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/opti9xx/miro.c | 8 ++++---- sound/isa/opti9xx/opti92x-ad1848.c | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-)
sound/isa/opti9xx/miro.c +4 -4
@@ -718,10 +718,10 @@ static int snd_miro_mixer(struct snd_card *card,switch (miro->hardware) {case OPTi9XX_HW_82C924: -strcpy (card->mixername,"ACI & OPTi924" ); +strscpy (card->mixername,"ACI & OPTi924" );break ;case OPTi9XX_HW_82C929: -strcpy (card->mixername,"ACI & OPTi929" ); +strscpy (card->mixername,"ACI & OPTi929" );break ;default :snd_BUG ();
@@ -779,7 +779,7 @@ static int snd_miro_init(struct snd_miro *chip,static const int opti9xx_mc_size[] = {7 ,7 ,10 ,10 ,2 ,2 ,2 }; chip->hardware = hardware; -strcpy (chip->name, snd_opti9xx_names[hardware]); +strscpy (chip->name, snd_opti9xx_names[hardware]); chip->mc_base_size = opti9xx_mc_size[hardware];
@@ -1351,7 +1351,7 @@ static int snd_miro_probe(struct snd_card *card)sprintf (card->shortname,"unknown Cardinal Technologies" ); } -strcpy (card->driver,"miro" ); +strscpy (card->driver,"miro" ); scnprintf(card->longname, sizeof(card->longname), "%s: OPTi%s, %s at 0x%lx, irq %d, dma %d&%d", card->shortname, miro->name, codec->pcm->name,
sound/isa/opti9xx/opti92x-ad1848.c +9 -9
@@ -171,7 +171,7 @@ static int snd_opti9xx_init(struct snd_opti9xx *chip,static const int opti9xx_mc_size[] = {7 ,7 ,10 ,10 ,2 ,2 ,2 }; chip->hardware = hardware; -strcpy (chip->name, snd_opti9xx_names[hardware]); +strscpy (chip->name, snd_opti9xx_names[hardware]);spin_lock_init (&chip->lock);
@@ -594,35 +594,35 @@ static int snd_opti93x_mixer(struct snd_wss *chip) card = chip->card; -strcpy (card->mixername, chip->pcm->name); +strscpy (card->mixername, chip->pcm->name);memset (&id1,0 ,sizeof (id1));memset (&id2,0 ,sizeof (id2)); id1.iface = id2.iface =SNDRV_CTL_ELEM_IFACE_MIXER ;/* reassign AUX0 switch to CD */ -strcpy (id1.name,"Aux Playback Switch" ); -strcpy (id2.name,"CD Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); +strscpy (id2.name,"CD Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 ) {dev_err (card->dev,"Cannot rename opti93x control\n" );return err; }/* reassign AUX1 switch to FM */ -strcpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; -strcpy (id2.name,"FM Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; +strscpy (id2.name,"FM Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 ) {dev_err (card->dev,"Cannot rename opti93x control\n" );return err; }/* remove AUX1 volume */ -strcpy (id1.name,"Aux Playback Volume" ); id1.index =1 ; +strscpy (id1.name,"Aux Playback Volume" ); id1.index =1 ;snd_ctl_remove_id (card, &id1);/* Replace WSS volume controls with OPTi93x volume controls */ id1.index =0 ;for (idx =0 ; idx <ARRAY_SIZE (snd_opti93x_controls); idx++) { -strcpy (id1.name, snd_opti93x_controls[idx].name); +strscpy (id1.name, snd_opti93x_controls[idx].name);snd_ctl_remove_id (card, &id1); err = snd_ctl_add(card,
@@ -857,7 +857,7 @@ static int snd_opti9xx_probe(struct snd_card *card)#endif chip->irq = irq; card->sync_irq = chip->irq; -strcpy (card->driver, chip->name); +strscpy (card->driver, chip->name);sprintf (card->shortname,"OPTi %s" , card->driver);#if defined(CS4231 ) || defined(OPTi93X) scnprintf(card->longname, sizeof(card->longname),
Signature · 1 line
2.50.0
PATCH 35/103 ALSA: sc6000: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/sc6000.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
sound/isa/sc6000.c +10 -10
@@ -469,24 +469,24 @@ static int snd_sc6000_mixer(struct snd_wss *chip) id1.iface =SNDRV_CTL_ELEM_IFACE_MIXER ; id2.iface =SNDRV_CTL_ELEM_IFACE_MIXER ;/* reassign AUX0 to FM */ -strcpy (id1.name,"Aux Playback Switch" ); -strcpy (id2.name,"FM Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); +strscpy (id2.name,"FM Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err; -strcpy (id1.name,"Aux Playback Volume" ); -strcpy (id2.name,"FM Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); +strscpy (id2.name,"FM Playback Volume" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err;/* reassign AUX1 to CD */ -strcpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; -strcpy (id2.name,"CD Playback Switch" ); +strscpy (id1.name,"Aux Playback Switch" ); id1.index =1 ; +strscpy (id2.name,"CD Playback Switch" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err; -strcpy (id1.name,"Aux Playback Volume" ); -strcpy (id2.name,"CD Playback Volume" ); +strscpy (id1.name,"Aux Playback Volume" ); +strscpy (id2.name,"CD Playback Volume" ); err =snd_ctl_rename_id (card, &id1, &id2);if (err <0 )return err;
@@ -652,8 +652,8 @@ static int __snd_sc6000_probe(struct device *devptr, unsigned int dev) mpu_port[dev]); } -strcpy (card->driver,DRV_NAME ); -strcpy (card->shortname,"SC-6000" ); +strscpy (card->driver,DRV_NAME ); +strscpy (card->shortname,"SC-6000" );sprintf (card->longname,"Gallant SC-6000 at 0x%lx, irq %d, dma %d" , mss_port[dev], xirq, xdma);
Signature · 1 line
2.50.0
PATCH 36/103 ALSA: sscape: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/sscape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/sscape.c +2 -2
@@ -1047,8 +1047,8 @@ static int create_sscape(int dev, struct snd_card *card) wss_port[dev], irq[dev]);return err; } -strcpy (card->driver,"SoundScape" ); -strcpy (card->shortname, name); +strscpy (card->driver,"SoundScape" ); +strscpy (card->shortname, name); snprintf(card->longname, sizeof(card->longname), "%s at 0x%lx, IRQ %d, DMA1 %d, DMA2 %d\n", name, sscape->chip->port, sscape->chip->irq,
Signature · 1 line
2.50.0
PATCH 37/103 ALSA: wavefront: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/wavefront/wavefront.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
sound/isa/wavefront/wavefront.c +8 -8
@@ -234,7 +234,7 @@ static struct snd_hwdep *snd_wavefront_new_synth(struct snd_card *card,if (snd_hwdep_new (card,"WaveFront" , hw_dev, &wavefront_synth) <0 )return NULL ; -strcpy (wavefront_synth->name, +strscpy (wavefront_synth->name,"WaveFront (ICS2115) wavetable synthesizer" ); wavefront_synth->ops.open = snd_wavefront_synth_open; wavefront_synth->ops.release = snd_wavefront_synth_release;
@@ -292,10 +292,10 @@ static struct snd_rawmidi *snd_wavefront_new_midi(struct snd_card *card,return NULL ;if (mpu == internal_mpu) { -strcpy (rmidi->name,"WaveFront MIDI (Internal)" ); +strscpy (rmidi->name,"WaveFront MIDI (Internal)" ); rmidi->private_data = &internal_id; }else { -strcpy (rmidi->name,"WaveFront MIDI (External)" ); +strscpy (rmidi->name,"WaveFront MIDI (External)" ); rmidi->private_data = &external_id; }
@@ -407,7 +407,7 @@ snd_wavefront_probe (struct snd_card *card, int dev)return -ENOMEM ; } -strcpy (wavefront_synth->name,"ICS2115 Wavetable MIDI Synthesizer" ); +strscpy (wavefront_synth->name,"ICS2115 Wavetable MIDI Synthesizer" ); wavefront_synth->iface =SNDRV_HWDEP_IFACE_ICS2115 ; hw_dev++;
@@ -478,12 +478,12 @@ snd_wavefront_probe (struct snd_card *card, int dev) hw_dev++; -strcpy (card->driver,"Tropez+" ); -strcpy (card->shortname,"Turtle Beach Tropez+" ); +strscpy (card->driver,"Tropez+" ); +strscpy (card->shortname,"Turtle Beach Tropez+" ); }else {/* Need a way to distinguish between Maui and Tropez */ -strcpy (card->driver,"WaveFront" ); -strcpy (card->shortname,"Turtle Beach WaveFront" ); +strscpy (card->driver,"WaveFront" ); +strscpy (card->shortname,"Turtle Beach WaveFront" ); }/* ----- Register the card --------- */
Signature · 1 line
2.50.0
PATCH 38/103 ALSA: wss: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/isa/wss/wss_lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/isa/wss/wss_lib.c +3 -3
@@ -1865,7 +1865,7 @@ int snd_wss_pcm(struct snd_wss *chip, int device) pcm->info_flags |=SNDRV_PCM_INFO_HALF_DUPLEX ;if (chip->hardware !=WSS_HW_INTERWAVE ) pcm->info_flags |=SNDRV_PCM_INFO_JOINT_DUPLEX ; -strcpy (pcm->name,snd_wss_chip_id (chip)); +strscpy (pcm->name,snd_wss_chip_id (chip));snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , chip->card->dev,64 *1024 , chip->dma1 >3 || chip->dma2 >3 ?128 *1024 :64 *1024 );
@@ -1896,7 +1896,7 @@ int snd_wss_timer(struct snd_wss *chip, int device) err =snd_timer_new (chip->card,"CS4231" , &tid, &timer);if (err <0 )return err; -strcpy (timer->name,snd_wss_chip_id (chip)); +strscpy (timer->name,snd_wss_chip_id (chip)); timer->private_data = chip; timer->private_free = snd_wss_timer_free; timer->hw = snd_wss_timer_table;
@@ -2176,7 +2176,7 @@ int snd_wss_mixer(struct snd_wss *chip) card = chip->card; -strcpy (card->mixername, chip->pcm->name); +strscpy (card->mixername, chip->pcm->name);/* Use only the first 11 entries on AD1848 */ if (chip->hardware &WSS_HW_AD1848_MASK )
Signature · 1 line
2.50.0
PATCH 39/103 ALSA: mips: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/mips/hal2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/mips/hal2.c +3 -3
@@ -706,7 +706,7 @@ static int hal2_pcm_create(struct snd_hal2 *hal2)return err; pcm->private_data = hal2; -strcpy (pcm->name,"SGI HAL2" ); +strscpy (pcm->name,"SGI HAL2" );/* set operators */ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
@@ -862,8 +862,8 @@ static int hal2_probe(struct platform_device *pdev)return err; } -strcpy (card->driver,"SGI HAL2 Audio" ); -strcpy (card->shortname,"SGI HAL2 Audio" ); +strscpy (card->driver,"SGI HAL2 Audio" ); +strscpy (card->shortname,"SGI HAL2 Audio" );sprintf (card->longname,"%s irq %i" , card->shortname,SGI_HPCDMA_IRQ );
Signature · 1 line
2.50.0
PATCH 40/103 ALSA: parisc: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/parisc/harmony.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/parisc/harmony.c +4 -4
@@ -601,7 +601,7 @@ snd_harmony_pcm_init(struct snd_harmony *h) pcm->private_data = h; pcm->info_flags =0 ; -strcpy (pcm->name,"harmony" ); +strscpy (pcm->name,"harmony" ); h->pcm = pcm; h->psubs =NULL ;
@@ -823,7 +823,7 @@ snd_harmony_mixer_init(struct snd_harmony *h)if (snd_BUG_ON (!h))return -EINVAL ; card = h->card; -strcpy (card->mixername,"Harmony Gain control interface" ); +strscpy (card->mixername,"Harmony Gain control interface" );for (idx =0 ; idx <HARMONY_CONTROLS ; idx++) { err = snd_ctl_add(card,
@@ -937,8 +937,8 @@ snd_harmony_probe(struct parisc_device *padev)if (err <0 ) goto free_and_ret; -strcpy (card->driver,"harmony" ); -strcpy (card->shortname,"Harmony" ); +strscpy (card->driver,"harmony" ); +strscpy (card->shortname,"Harmony" );sprintf (card->longname,"%s at 0x%lx, irq %i" , card->shortname, h->hpa, h->irq);
Signature · 1 line
2.50.0
PATCH 41/103 ALSA: ac97: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/ac97/ac97_codec.c | 4 ++-- sound/pci/ac97/ac97_patch.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
sound/pci/ac97/ac97_codec.c +2 -2
@@ -2303,7 +2303,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,if (ac97_is_audio (ac97)) {char comp[16 ];if (card->mixername[0 ] =='\0' ) { -strcpy (card->mixername, name); +strscpy (card->mixername, name); }else {if (strlen (card->mixername) +1 +strlen (name) +1 <=sizeof (card->mixername)) {strcat (card->mixername,"," );
@@ -2324,7 +2324,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,if (ac97_is_modem (ac97)) {char comp[16 ];if (card->mixername[0 ] =='\0' ) { -strcpy (card->mixername, name); +strscpy (card->mixername, name); }else {if (strlen (card->mixername) +1 +strlen (name) +1 <=sizeof (card->mixername)) {strcat (card->mixername,"," );
sound/pci/ac97/ac97_patch.c +4 -4
@@ -298,7 +298,7 @@ static int patch_yamaha_ymf7x3_3d(struct snd_ac97 *ac97) err =snd_ctl_add (ac97->bus->card, kctl);if (err <0 )return err; -strcpy (kctl->id.name,"3D Control - Wide" ); +strscpy (kctl->id.name,"3D Control - Wide" ); kctl->private_value =AC97_SINGLE_VALUE (AC97_3D_CONTROL ,9 ,7 ,0 );snd_ac97_write_cache (ac97,AC97_3D_CONTROL ,0x0000 ); err = snd_ctl_add(ac97->bus->card,
@@ -891,7 +891,7 @@ static int patch_sigmatel_stac9700_3d(struct snd_ac97 * ac97) err =snd_ctl_add (ac97->bus->card, kctl =snd_ac97_cnew (&snd_ac97_controls_3d[0 ], ac97));if (err <0 )return err; -strcpy (kctl->id.name,"3D Control Sigmatel - Depth" ); +strscpy (kctl->id.name,"3D Control Sigmatel - Depth" ); kctl->private_value =AC97_SINGLE_VALUE (AC97_3D_CONTROL ,2 ,3 ,0 );snd_ac97_write_cache (ac97,AC97_3D_CONTROL ,0x0000 );return 0 ;
@@ -906,13 +906,13 @@ static int patch_sigmatel_stac9708_3d(struct snd_ac97 * ac97) err =snd_ctl_add (ac97->bus->card, kctl);if (err <0 )return err; -strcpy (kctl->id.name,"3D Control Sigmatel - Depth" ); +strscpy (kctl->id.name,"3D Control Sigmatel - Depth" ); kctl->private_value =AC97_SINGLE_VALUE (AC97_3D_CONTROL ,0 ,3 ,0 ); kctl =snd_ac97_cnew (&snd_ac97_controls_3d[0 ], ac97); err =snd_ctl_add (ac97->bus->card, kctl);if (err <0 )return err; -strcpy (kctl->id.name,"3D Control Sigmatel - Rear Depth" ); +strscpy (kctl->id.name,"3D Control Sigmatel - Rear Depth" ); kctl->private_value =AC97_SINGLE_VALUE (AC97_3D_CONTROL ,2 ,3 ,0 );snd_ac97_write_cache (ac97,AC97_3D_CONTROL ,0x0000 );return 0 ;
Signature · 1 line
2.50.0
PATCH 42/103 ALSA: ad1889: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/ad1889.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/ad1889.c +3 -3
@@ -605,7 +605,7 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device) pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcm = pcm; chip->psubs =NULL ;
@@ -866,8 +866,8 @@ __snd_ad1889_probe(struct pci_dev *pci,return err; chip = card->private_data; -strcpy (card->driver,"AD1889" ); -strcpy (card->shortname,"Analog Devices AD1889" ); +strscpy (card->driver,"AD1889" ); +strscpy (card->shortname,"Analog Devices AD1889" );/* (3) */ err =snd_ad1889_create (card, pci);
Signature · 1 line
2.50.0
PATCH 43/103 ALSA: ak4531: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/ak4531_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/ak4531_codec.c +1 -1
@@ -389,7 +389,7 @@ int snd_ak4531_mixer(struct snd_card *card,snd_ak4531_free (ak4531);return err; } -strcpy (card->mixername,"Asahi Kasei AK4531" ); +strscpy (card->mixername,"Asahi Kasei AK4531" ); ak4531->write (ak4531,AK4531_RESET ,0x03 );/* no RST, PD */ udelay (100 ); ak4531->write (ak4531,AK4531_CLOCK ,0x00 );/* CODEC ADC and CODEC DAC use {LR,B}CLK2 and run off LRCLK2 PLL */
Signature · 1 line
2.50.0
PATCH 44/103 ALSA: ali5451: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/ali5451/ali5451.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/ali5451/ali5451.c +3 -3
@@ -1645,7 +1645,7 @@ static int snd_ali_pcm(struct snd_ali *codec, int device, pcm->info_flags =0 ; pcm->dev_class = desc->class; pcm->dev_subclass =SNDRV_PCM_SUBCLASS_GENERIC_MIX ; -strcpy (pcm->name, desc->name); +strscpy (pcm->name, desc->name); codec->pcm[0 ] = pcm;return 0 ; }
@@ -2133,8 +2133,8 @@ static int __snd_ali_probe(struct pci_dev *pci,snd_ali_proc_init (codec); -strcpy (card->driver,"ALI5451" ); -strcpy (card->shortname,"ALI 5451" ); +strscpy (card->driver,"ALI5451" ); +strscpy (card->shortname,"ALI 5451" );sprintf (card->longname,"%s at 0x%lx, irq %i" , card->shortname, codec->port, codec->irq);
Signature · 1 line
2.50.0
PATCH 45/103 ALSA: als300: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/als300.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/als300.c +2 -2
@@ -546,7 +546,7 @@ static int snd_als300_new_pcm(struct snd_als300 *chip)if (err <0 )return err; pcm->private_data = chip; -strcpy (pcm->name,"ALS300" ); +strscpy (pcm->name,"ALS300" ); chip->pcm = pcm;/* set operators */
@@ -705,7 +705,7 @@ static int snd_als300_probe(struct pci_dev *pci,if (err <0 ) goto error; -strcpy (card->driver,"ALS300" ); +strscpy (card->driver,"ALS300" );if (chip->chip_type ==DEVICE_ALS300_PLUS )/* don't know much about ALS300+ yet * print revision number for now */
Signature · 1 line
2.50.0
PATCH 46/103 ALSA: als4000: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/als4000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/als4000.c +2 -2
@@ -877,8 +877,8 @@ static int __snd_card_als4000_probe(struct pci_dev *pci,snd_als4000_configure (chip); -strcpy (card->driver,"ALS4000" ); -strcpy (card->shortname,"Avance Logic ALS4000" ); +strscpy (card->driver,"ALS4000" ); +strscpy (card->shortname,"Avance Logic ALS4000" );sprintf (card->longname,"%s at 0x%lx, irq %i" , card->shortname, chip->alt_port, chip->irq);
Signature · 1 line
2.50.0
PATCH 47/103 ALSA: asihpi: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/asihpi/asihpi.c | 10 +++++----- sound/pci/asihpi/hpi6000.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
sound/pci/asihpi/asihpi.c +5 -5
@@ -1257,7 +1257,7 @@ static int snd_card_asihpi_pcm_new(struct snd_card_asihpi *asihpi, int device) pcm->private_data = asihpi; pcm->info_flags =0 ; -strcpy (pcm->name,"Asihpi PCM" ); +strscpy (pcm->name,"Asihpi PCM" );/*? do we want to emulate MMAP for non-BBM cards? Jack doesn't work with ALSAs MMAP emulation - WHY NOT? */
@@ -2310,7 +2310,7 @@ static int snd_asihpi_clksrc_info(struct snd_kcontrol *kcontrol, uinfo->value.enumerated.item = uinfo->value.enumerated.items -1 ; -strcpy (uinfo->value.enumerated.name, +strscpy (uinfo->value.enumerated.name, clkcache->s[uinfo->value.enumerated.item].name);return 0 ; }
@@ -2530,7 +2530,7 @@ static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi)if (snd_BUG_ON (!asihpi))return -EINVAL ; card = asihpi->card; -strcpy (card->mixername,"Asihpi Mixer" ); +strscpy (card->mixername,"Asihpi Mixer" ); err = hpi_mixer_open(asihpi->hpi->adapter->index,
@@ -2741,7 +2741,7 @@ static int snd_asihpi_hpi_new(struct snd_card_asihpi *asihpi, int device) err =snd_hwdep_new (asihpi->card,"HPI" , device, &hw);if (err <0 )return err; -strcpy (hw->name,"asihpi (HPI)" ); +strscpy (hw->name,"asihpi (HPI)" ); hw->iface =SNDRV_HWDEP_IFACE_LAST ; hw->ops.open = snd_asihpi_hpi_open; hw->ops.ioctl = snd_asihpi_hpi_ioctl;
@@ -2889,7 +2889,7 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev,by enable_hwdep module param*/ snd_asihpi_hpi_new (asihpi,0 ); -strcpy (card->driver,"ASIHPI" ); +strscpy (card->driver,"ASIHPI" );sprintf (card->shortname,"AudioScience ASI%4X" , asihpi->hpi->adapter->type);
sound/pci/asihpi/hpi6000.c +1 -1
@@ -608,7 +608,7 @@ static void adapter_get_asserts(struct hpi_adapter_obj *pao, phr->u.ax.assert.p2 =0 ; phr->u.ax.assert.count =1 ;/* assert count */ phr->u.ax.assert.dsp_index =-1 ;/* "dsp index" */ -strcpy (phr->u.ax.assert.sz_message,"PCI2040 error" ); +strscpy (phr->u.ax.assert.sz_message,"PCI2040 error" ); phr->u.ax.assert.dsp_msg_addr =0 ; gw_pci_read_asserts =0 ; gw_pci_write_asserts =0 ;
Signature · 1 line
2.50.0
PATCH 48/103 ALSA: atiixp: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/atiixp.c | 10 +++++----- sound/pci/atiixp_modem.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-)
sound/pci/atiixp.c +5 -5
@@ -1271,7 +1271,7 @@ static int snd_atiixp_pcm_new(struct atiixp *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_atiixp_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_atiixp_capture_ops); pcm->private_data = chip; -strcpy (pcm->name,"ATI IXP AC97" ); +strscpy (pcm->name,"ATI IXP AC97" ); chip->pcmdevs[ATI_PCMDEV_ANALOG ] = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1301,9 +1301,9 @@ static int snd_atiixp_pcm_new(struct atiixp *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_atiixp_spdif_ops); pcm->private_data = chip;if (chip->spdif_over_aclink) -strcpy (pcm->name,"ATI IXP IEC958 (AC97)" ); +strscpy (pcm->name,"ATI IXP IEC958 (AC97)" );else -strcpy (pcm->name,"ATI IXP IEC958 (Direct)" ); +strscpy (pcm->name,"ATI IXP IEC958 (Direct)" ); chip->pcmdevs[ATI_PCMDEV_DIGITAL ] = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1576,8 +1576,8 @@ static int __snd_atiixp_probe(struct pci_dev *pci,return err; chip = card->private_data; -strcpy (card->driver, spdif_aclink ?"ATIIXP" :"ATIIXP-SPDMA" ); -strcpy (card->shortname,"ATI IXP" ); +strscpy (card->driver, spdif_aclink ?"ATIIXP" :"ATIIXP-SPDMA" ); +strscpy (card->shortname,"ATI IXP" ); err =snd_atiixp_init (card, pci);if (err <0 )return err;
sound/pci/atiixp_modem.c +3 -3
@@ -982,7 +982,7 @@ static int snd_atiixp_pcm_new(struct atiixp_modem *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_atiixp_capture_ops); pcm->dev_class =SNDRV_PCM_CLASS_MODEM ; pcm->private_data = chip; -strcpy (pcm->name,"ATI IXP MC97" ); +strscpy (pcm->name,"ATI IXP MC97" ); chip->pcmdevs[ATI_PCMDEV_ANALOG ] = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1206,8 +1206,8 @@ static int __snd_atiixp_probe(struct pci_dev *pci,return err; chip = card->private_data; -strcpy (card->driver,"ATIIXP-MODEM" ); -strcpy (card->shortname,"ATI IXP Modem" ); +strscpy (card->driver,"ATIIXP-MODEM" ); +strscpy (card->shortname,"ATI IXP Modem" ); err =snd_atiixp_init (card, pci);if (err <0 )return err;
Signature · 1 line
2.50.0
PATCH 49/103 ALSA: au88x0: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/au88x0/au88x0.c | 4 ++-- sound/pci/au88x0/au88x0_mixer.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
sound/pci/au88x0/au88x0.c +2 -2
@@ -220,7 +220,7 @@ __snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)snd_vortex_workaround (pci, pcifix[dev]);// Card details needed in snd_vortex_midi -strcpy (card->driver,CARD_NAME_SHORT ); +strscpy (card->driver,CARD_NAME_SHORT );sprintf (card->shortname,"Aureal Vortex %s" ,CARD_NAME_SHORT );sprintf (card->longname,"%s at 0x%lx irq %i" , card->shortname, chip->io, chip->irq);
@@ -270,7 +270,7 @@ __snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)snd_vortex_synth_arg_t *arg; arg =SNDRV_SEQ_DEVICE_ARGPTR (wave); -strcpy (wave->name,"Aureal Synth" ); +strscpy (wave->name,"Aureal Synth" ); arg->hwptr = vortex; arg->index =1 ; arg->seq_ports = seq_ports[dev];
sound/pci/au88x0/au88x0_mixer.c +1 -1
@@ -15,7 +15,7 @@ static int remove_ctl(struct snd_card *card, const char *name) {struct snd_ctl_elem_id id;memset (&id,0 ,sizeof (id)); -strcpy (id.name, name); +strscpy (id.name, name); id.iface =SNDRV_CTL_ELEM_IFACE_MIXER ;return snd_ctl_remove_id (card, &id); }
Signature · 1 line
2.50.0
PATCH 50/103 ALSA: aw2: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/aw2/aw2-alsa.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
sound/pci/aw2/aw2-alsa.c +5 -5
@@ -281,8 +281,8 @@ static int snd_aw2_probe(struct pci_dev *pci,/* init spinlock */ spin_lock_init (&chip->reg_lock);/* (4) Define driver ID and name string */ -strcpy (card->driver,"aw2" ); -strcpy (card->shortname,"Audiowerk2" ); +strscpy (card->driver,"aw2" ); +strscpy (card->shortname,"Audiowerk2" );sprintf (card->longname,"%s with SAA7146 irq %i" , card->shortname, chip->irq);
@@ -509,7 +509,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip) pcm_device = &chip->device_playback[NUM_STREAM_PLAYBACK_ANA ];/* Set PCM device name */ -strcpy (pcm_playback_ana->name,"Analog playback" ); +strscpy (pcm_playback_ana->name,"Analog playback" );/* Associate private data to PCM device */ pcm_playback_ana->private_data = pcm_device;/* set operators of PCM device */
@@ -541,7 +541,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip) pcm_device = &chip->device_playback[NUM_STREAM_PLAYBACK_DIG ];/* Set PCM device name */ -strcpy (pcm_playback_num->name,"Digital playback" ); +strscpy (pcm_playback_num->name,"Digital playback" );/* Associate private data to PCM device */ pcm_playback_num->private_data = pcm_device;/* set operators of PCM device */
@@ -574,7 +574,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip) pcm_device = &chip->device_capture[NUM_STREAM_CAPTURE_ANA ];/* Set PCM device name */ -strcpy (pcm_capture->name,"Capture" ); +strscpy (pcm_capture->name,"Capture" );/* Associate private data to PCM device */ pcm_capture->private_data = pcm_device;/* set operators of PCM device */
Signature · 1 line
2.50.0
PATCH 51/103 ALSA: azt3328: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/azt3328.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
sound/pci/azt3328.c +6 -6
@@ -1188,7 +1188,7 @@ snd_azf3328_mixer_new(struct snd_azf3328 *chip)return err; }snd_component_add (card,"AZF3328 mixer" ); -strcpy (card->mixername,"AZF3328 mixer" ); +strscpy (card->mixername,"AZF3328 mixer" );return 0 ; }
@@ -2095,7 +2095,7 @@ snd_azf3328_pcm(struct snd_azf3328 *chip) pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname);/* same pcm object for playback/capture (see snd_pcm_new() above) */ chip->pcm[AZF_CODEC_PLAYBACK ] = pcm; chip->pcm[AZF_CODEC_CAPTURE ] = pcm;
@@ -2112,7 +2112,7 @@ snd_azf3328_pcm(struct snd_azf3328 *chip) pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcm[AZF_CODEC_I2S_OUT ] = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &chip->pci->dev,
@@ -2217,7 +2217,7 @@ snd_azf3328_timer(struct snd_azf3328 *chip, int device)if (err <0 ) goto out; -strcpy (timer->name,"AZF3328 timer" ); +strscpy (timer->name,"AZF3328 timer" ); timer->private_data = chip; timer->hw = snd_azf3328_timer_hw;
@@ -2437,8 +2437,8 @@ __snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)return err; chip = card->private_data; -strcpy (card->driver,"AZF3328" ); -strcpy (card->shortname,"Aztech AZF3328 (PCI168)" ); +strscpy (card->driver,"AZF3328" ); +strscpy (card->shortname,"Aztech AZF3328 (PCI168)" ); err =snd_azf3328_create (card, pci, pci_id->driver_data);if (err <0 )
Signature · 1 line
2.50.0
PATCH 52/103 ALSA: bt87x: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/bt87x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/bt87x.c +3 -3
@@ -672,7 +672,7 @@ static int snd_bt87x_pcm(struct snd_bt87x *chip, int device, char *name)if (err <0 )return err; pcm->private_data = chip; -strcpy (pcm->name, name); +strscpy (pcm->name, name);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_bt87x_pcm_ops); snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV_SG, &chip->pci->dev,
@@ -872,12 +872,12 @@ static int __snd_bt87x_probe(struct pci_dev *pci, chip->board.no_analog ?"no " :"" , chip->board.no_digital ? "no " : "", chip->board.dig_rate); -strcpy (card->driver,"Bt87x" ); +strscpy (card->driver,"Bt87x" );sprintf (card->shortname,"Brooktree Bt%x" , pci->device);sprintf (card->longname,"%s at %#llx, irq %i" , card->shortname, (unsigned long long )pci_resource_start (pci,0 ), chip->irq); -strcpy (card->mixername,"Bt87x" ); +strscpy (card->mixername,"Bt87x" ); err =snd_card_register (card);if (err <0 )
Signature · 1 line
2.50.0
PATCH 53/103 ALSA: ca0106: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/ca0106/ca0106_main.c | 6 +++--- sound/pci/ca0106/ca0106_mixer.c | 4 ++-- sound/pci/ca0106/ca_midi.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
sound/pci/ca0106/ca0106_main.c +3 -3
@@ -1315,7 +1315,7 @@ static int snd_ca0106_pcm(struct snd_ca0106 *emu, int device) } pcm->info_flags =0 ; -strcpy (pcm->name,"CA0106" ); +strscpy (pcm->name,"CA0106" ); for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream;
@@ -1617,8 +1617,8 @@ static int snd_ca0106_create(int dev, struct snd_card *card,pci_read_config_word (pci,PCI_SUBSYSTEM_ID , &chip->model);dev_info (card->dev,"Model %04x Rev %08x Serial %08x\n" , chip->model, pci->revision, chip->serial); -strcpy (card->driver,"CA0106" ); -strcpy (card->shortname,"CA0106" ); +strscpy (card->driver,"CA0106" ); +strscpy (card->shortname,"CA0106" );for (c = ca0106_chip_details; c->serial; c++) {if (subsystem[dev]) {
sound/pci/ca0106/ca0106_mixer.c +2 -2
@@ -701,7 +701,7 @@ static int remove_ctl(struct snd_card *card, const char *name) {struct snd_ctl_elem_id id;memset (&id,0 ,sizeof (id)); -strcpy (id.name, name); +strscpy (id.name, name); id.iface =SNDRV_CTL_ELEM_IFACE_MIXER ;return snd_ctl_remove_id (card, &id); }
@@ -849,7 +849,7 @@ int snd_ca0106_mixer(struct snd_ca0106 *emu)return err; } -strcpy (card->mixername,"CA0106" ); +strscpy (card->mixername,"CA0106" );return 0 ; }
sound/pci/ca0106/ca_midi.c +1 -1
@@ -287,7 +287,7 @@ int ca_midi_init(void *dev_id, struct snd_ca_midi *midi, int device, char *name)spin_lock_init (&midi->input_lock);spin_lock_init (&midi->output_lock); -strcpy (rmidi->name, name); +strscpy (rmidi->name, name);snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_OUTPUT , &ca_midi_output);snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_INPUT , &ca_midi_input); rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT |
Signature · 1 line
2.50.0
PATCH 54/103 ALSA: cmipci: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/cmipci.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/pci/cmipci.c +7 -7
@@ -1868,7 +1868,7 @@ static int snd_cmipci_pcm_new(struct cmipci *cm, int device) pcm->private_data = cm; pcm->info_flags =0 ; -strcpy (pcm->name,"C-Media PCI DAC/ADC" ); +strscpy (pcm->name,"C-Media PCI DAC/ADC" ); cm->pcm = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1890,7 +1890,7 @@ static int snd_cmipci_pcm2_new(struct cmipci *cm, int device) pcm->private_data = cm; pcm->info_flags =0 ; -strcpy (pcm->name,"C-Media PCI 2nd DAC" ); +strscpy (pcm->name,"C-Media PCI 2nd DAC" ); cm->pcm2 = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1913,7 +1913,7 @@ static int snd_cmipci_pcm_spdif_new(struct cmipci *cm, int device) pcm->private_data = cm; pcm->info_flags =0 ; -strcpy (pcm->name,"C-Media PCI IEC958" ); +strscpy (pcm->name,"C-Media PCI IEC958" ); cm->pcm_spdif = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -2633,7 +2633,7 @@ static int snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_device) card = cm->card; -strcpy (card->mixername,"CMedia PCI" ); +strscpy (card->mixername,"CMedia PCI" );spin_lock_irq (&cm->reg_lock);snd_cmipci_mixer_write (cm,0x00 ,0x00 );/* mixer reset */
@@ -3216,14 +3216,14 @@ static int snd_cmipci_probe(struct pci_dev *pci,switch (pci->device) {case PCI_DEVICE_ID_CMEDIA_CM8738 :case PCI_DEVICE_ID_CMEDIA_CM8738B : -strcpy (card->driver,"CMI8738" ); +strscpy (card->driver,"CMI8738" );break ;case PCI_DEVICE_ID_CMEDIA_CM8338A :case PCI_DEVICE_ID_CMEDIA_CM8338B : -strcpy (card->driver,"CMI8338" ); +strscpy (card->driver,"CMI8338" );break ;default : -strcpy (card->driver,"CMIPCI" ); +strscpy (card->driver,"CMIPCI" );break ; }
Signature · 1 line
2.50.0
PATCH 55/103 ALSA: cs4281: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/cs4281.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/pci/cs4281.c +4 -4
@@ -950,7 +950,7 @@ static int snd_cs4281_pcm(struct cs4281 *chip, int device) pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name,"CS4281" ); +strscpy (pcm->name,"CS4281" ); chip->pcm = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &chip->pci->dev,
@@ -1715,7 +1715,7 @@ static int snd_cs4281_midi(struct cs4281 *chip, int device) err =snd_rawmidi_new (chip->card,"CS4281" , device,1 ,1 , &rmidi);if (err <0 )return err; -strcpy (rmidi->name,"CS4281" ); +strscpy (rmidi->name,"CS4281" );snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_OUTPUT , &snd_cs4281_midi_output);snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_INPUT , &snd_cs4281_midi_input); rmidi->info_flags |=SNDRV_RAWMIDI_INFO_OUTPUT |SNDRV_RAWMIDI_INFO_INPUT |SNDRV_RAWMIDI_INFO_DUPLEX ;
@@ -1870,8 +1870,8 @@ static int __snd_cs4281_probe(struct pci_dev *pci,if (err <0 )return err;snd_cs4281_create_gameport (chip); -strcpy (card->driver,"CS4281" ); -strcpy (card->shortname,"Cirrus Logic CS4281" ); +strscpy (card->driver,"CS4281" ); +strscpy (card->shortname,"Cirrus Logic CS4281" ); sprintf(card->longname, "%s at 0x%lx, irq %d", card->shortname, chip->ba0_addr,
Signature · 1 line
2.50.0
Re: [PATCH 055/103] ALSA: cs4281: Use safer strscpy() instead of strcpy()
Quoted 7 lines · Takashi Iwai
Use a safer function
strscpy()instead ofstrcpy()for copying to arrays.Only idiomatic code replacement, and no functional changes.
Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 56/103 ALSA: cs46xx: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/cs46xx/cs46xx.c | 4 ++-- sound/pci/cs46xx/cs46xx_lib.c | 20 ++++++++++---------- sound/pci/cs46xx/dsp_spos.c | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-)
sound/pci/cs46xx/cs46xx.c +2 -2
@@ -107,8 +107,8 @@ static int snd_card_cs46xx_probe(struct pci_dev *pci,snd_cs46xx_gameport (chip); -strcpy (card->driver,"CS46xx" ); -strcpy (card->shortname,"Sound Fusion CS46xx" ); +strscpy (card->driver,"CS46xx" ); +strscpy (card->shortname,"Sound Fusion CS46xx" ); sprintf(card->longname, "%s at 0x%lx/0x%lx, irq %i", card->shortname, chip->ba0_addr,
sound/pci/cs46xx/cs46xx_lib.c +10 -10
@@ -1760,7 +1760,7 @@ int snd_cs46xx_pcm(struct snd_cs46xx *chip, int device)/* global setup */ pcm->info_flags =0 ; -strcpy (pcm->name,"CS46xx" ); +strscpy (pcm->name,"CS46xx" ); chip->pcm = pcm; snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1787,7 +1787,7 @@ int snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device)/* global setup */ pcm->info_flags =0 ; -strcpy (pcm->name,"CS46xx - Rear" ); +strscpy (pcm->name,"CS46xx - Rear" ); chip->pcm_rear = pcm; snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1812,7 +1812,7 @@ int snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device)/* global setup */ pcm->info_flags =0 ; -strcpy (pcm->name,"CS46xx - Center LFE" ); +strscpy (pcm->name,"CS46xx - Center LFE" ); chip->pcm_center_lfe = pcm; snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1837,7 +1837,7 @@ int snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device)/* global setup */ pcm->info_flags =0 ; -strcpy (pcm->name,"CS46xx - IEC958" ); +strscpy (pcm->name,"CS46xx - IEC958" ); chip->pcm_iec958 = pcm; snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -2672,7 +2672,7 @@ int snd_cs46xx_midi(struct snd_cs46xx *chip, int device) err =snd_rawmidi_new (chip->card,"CS46XX" , device,1 ,1 , &rmidi);if (err <0 )return err; -strcpy (rmidi->name,"CS46XX" ); +strscpy (rmidi->name,"CS46XX" );snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_OUTPUT , &snd_cs46xx_midi_output);snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_INPUT , &snd_cs46xx_midi_input); rmidi->info_flags |=SNDRV_RAWMIDI_INFO_OUTPUT |SNDRV_RAWMIDI_INFO_INPUT |SNDRV_RAWMIDI_INFO_DUPLEX ;
@@ -3853,27 +3853,27 @@ int snd_cs46xx_create(struct snd_card *card, } region = &chip->region.name.ba0; -strcpy (region->name,"CS46xx_BA0" ); +strscpy (region->name,"CS46xx_BA0" ); region->base = chip->ba0_addr; region->size =CS46XX_BA0_SIZE ; region = &chip->region.name.data0; -strcpy (region->name,"CS46xx_BA1_data0" ); +strscpy (region->name,"CS46xx_BA1_data0" ); region->base = chip->ba1_addr +BA1_SP_DMEM0 ; region->size =CS46XX_BA1_DATA0_SIZE ; region = &chip->region.name.data1; -strcpy (region->name,"CS46xx_BA1_data1" ); +strscpy (region->name,"CS46xx_BA1_data1" ); region->base = chip->ba1_addr +BA1_SP_DMEM1 ; region->size =CS46XX_BA1_DATA1_SIZE ; region = &chip->region.name.pmem; -strcpy (region->name,"CS46xx_BA1_pmem" ); +strscpy (region->name,"CS46xx_BA1_pmem" ); region->base = chip->ba1_addr +BA1_SP_PMEM ; region->size =CS46XX_BA1_PRG_SIZE ; region = &chip->region.name.reg; -strcpy (region->name,"CS46xx_BA1_reg" ); +strscpy (region->name,"CS46xx_BA1_reg" ); region->base = chip->ba1_addr +BA1_SP_REG ; region->size =CS46XX_BA1_REG_SIZE ;
sound/pci/cs46xx/dsp_spos.c +4 -4
@@ -203,7 +203,7 @@ add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type) index =find_free_symbol_index (ins); -strcpy (ins->symbol_table.symbols[index].symbol_name, symbol_name); +strscpy (ins->symbol_table.symbols[index].symbol_name, symbol_name); ins->symbol_table.symbols[index].address = address; ins->symbol_table.symbols[index].symbol_type = type; ins->symbol_table.symbols[index].module =NULL ;
@@ -923,7 +923,7 @@ static struct dsp_scb_descriptor * _map_scb (struct snd_cs46xx *chip, char * nam index =find_free_scb_index (ins);memset (&ins->scbs[index],0 ,sizeof (ins->scbs[index])); -strcpy (ins->scbs[index].scb_name, name); +strscpy (ins->scbs[index].scb_name, name); ins->scbs[index].address = dest; ins->scbs[index].index = index; ins->scbs[index].ref_count =1 ;
@@ -953,9 +953,9 @@ _map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size) }if (name) -strcpy (ins->tasks[ins->ntask].task_name, name); +strscpy (ins->tasks[ins->ntask].task_name, name);else -strcpy (ins->tasks[ins->ntask].task_name,"(NULL)" ); +strscpy (ins->tasks[ins->ntask].task_name,"(NULL)" ); ins->tasks[ins->ntask].address = dest; ins->tasks[ins->ntask].size = size;
Signature · 1 line
2.50.0
Re: [PATCH 056/103] ALSA: cs46xx: Use safer strscpy() instead of strcpy()
Quoted 7 lines · Takashi Iwai
Use a safer function
strscpy()instead ofstrcpy()for copying to arrays.Only idiomatic code replacement, and no functional changes.
Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 57/103 ALSA: cs5530: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/cs5530.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/cs5530.c +2 -2
@@ -207,8 +207,8 @@ static int snd_cs5530_probe(struct pci_dev *pci,if (err <0 )return err; -strcpy (card->driver,"CS5530" ); -strcpy (card->shortname,"CS5530 Audio" ); +strscpy (card->driver,"CS5530" ); +strscpy (card->shortname,"CS5530 Audio" );sprintf (card->longname,"%s at 0x%lx" , card->shortname, chip->pci_base); err =snd_card_register (card);
Signature · 1 line
2.50.0
Re: [PATCH 057/103] ALSA: cs5530: Use safer strscpy() instead of strcpy()
Quoted 7 lines · Takashi Iwai
Use a safer function
strscpy()instead ofstrcpy()for copying to arrays.Only idiomatic code replacement, and no functional changes.
Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 58/103 ALSA: cs5535audio: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/cs5535audio/cs5535audio.c | 4 ++-- sound/pci/cs5535audio/cs5535audio_pcm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
sound/pci/cs5535audio/cs5535audio.c +2 -2
@@ -315,9 +315,9 @@ static int __snd_cs5535audio_probe(struct pci_dev *pci,if (err <0 )return err; -strcpy (card->driver,DRIVER_NAME ); +strscpy (card->driver,DRIVER_NAME ); -strcpy (card->shortname,"CS5535 Audio" ); +strscpy (card->shortname,"CS5535 Audio" );sprintf (card->longname,"%s %s at 0x%lx, irq %i" , card->shortname, card->driver, cs5535au->port, cs5535au->irq);
sound/pci/cs5535audio/cs5535audio_pcm.c +1 -1
@@ -423,7 +423,7 @@ int snd_cs5535audio_pcm(struct cs5535audio *cs5535au) pcm->private_data = cs5535au; pcm->info_flags =0 ; -strcpy (pcm->name,"CS5535 Audio" ); +strscpy (pcm->name,"CS5535 Audio" ); snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &cs5535au->pci->dev,
Signature · 1 line
2.50.0
Re: [PATCH 058/103] ALSA: cs5535audio: Use safer strscpy() instead of strcpy()
Quoted 7 lines · Takashi Iwai
Use a safer function
strscpy()instead ofstrcpy()for copying to arrays.Only idiomatic code replacement, and no functional changes.
Signed-off-by Takashi Iwai <[email protected]>---
Thanks,
Charles
PATCH 59/103 ALSA: ctxfi: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/ctxfi/ctmixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/ctxfi/ctmixer.c +1 -1
@@ -1219,7 +1219,7 @@ int ct_alsa_mix_create(struct ct_atc *atc,if (err)return err; -strcpy (atc->card->mixername, device_name); +strscpy (atc->card->mixername, device_name);return 0 ; }
Signature · 1 line
2.50.0
PATCH 60/103 ALSA: echoaudio: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/echoaudio/midi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/echoaudio/midi.c +1 -1
@@ -311,7 +311,7 @@ static int snd_echo_midi_create(struct snd_card *card,if (err <0 )return err; -strcpy (chip->rmidi->name, card->shortname); +strscpy (chip->rmidi->name, card->shortname); chip->rmidi->private_data = chip; snd_rawmidi_set_ops(chip->rmidi, SNDRV_RAWMIDI_STREAM_INPUT,
Signature · 1 line
2.50.0
PATCH 61/103 ALSA: emu10k1: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/emu10k1/emumpu401.c | 2 +- sound/pci/emu10k1/emupcm.c | 10 +++++----- sound/pci/emu10k1/p16v.c | 2 +- sound/pci/emu10k1/timer.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
sound/pci/emu10k1/emumpu401.c +1 -1
@@ -320,7 +320,7 @@ static int emu10k1_midi_init(struct snd_emu10k1 *emu, struct snd_emu10k1_midi *mspin_lock_init (&midi->open_lock);spin_lock_init (&midi->input_lock);spin_lock_init (&midi->output_lock); -strcpy (rmidi->name, name); +strscpy (rmidi->name, name);snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_OUTPUT , &snd_emu10k1_midi_output);snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_INPUT , &snd_emu10k1_midi_input); rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT |
sound/pci/emu10k1/emupcm.c +5 -5
@@ -1425,7 +1425,7 @@ int snd_emu10k1_pcm(struct snd_emu10k1 *emu, int device) pcm->info_flags =0 ; pcm->dev_subclass =SNDRV_PCM_SUBCLASS_GENERIC_MIX ; -strcpy (pcm->name,"ADC Capture/Standard PCM Playback" ); +strscpy (pcm->name,"ADC Capture/Standard PCM Playback" ); emu->pcm = pcm;/* playback substream can't use managed buffers due to alignment */
@@ -1457,7 +1457,7 @@ int snd_emu10k1_pcm_multi(struct snd_emu10k1 *emu, int device) pcm->info_flags =0 ; pcm->dev_subclass =SNDRV_PCM_SUBCLASS_GENERIC_MIX ; -strcpy (pcm->name,"Multichannel Playback" ); +strscpy (pcm->name,"Multichannel Playback" ); emu->pcm_multi = pcm;for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK ].substream; substream; substream = substream->next)
@@ -1491,7 +1491,7 @@ int snd_emu10k1_pcm_mic(struct snd_emu10k1 *emu, int device)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_emu10k1_capture_mic_ops); pcm->info_flags =0 ; -strcpy (pcm->name,"Mic Capture" ); +strscpy (pcm->name,"Mic Capture" ); emu->pcm_mic = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &emu->pci->dev,
@@ -1818,9 +1818,9 @@ int snd_emu10k1_pcm_efx(struct snd_emu10k1 *emu, int device) pcm->info_flags =0 ;if (emu->audigy) -strcpy (pcm->name,"Multichannel Capture" ); +strscpy (pcm->name,"Multichannel Capture" );else -strcpy (pcm->name,"Multichannel Capture/PT Playback" ); +strscpy (pcm->name,"Multichannel Capture/PT Playback" ); emu->pcm_efx = pcm;if (!emu->card_capabilities->emu_model) {
sound/pci/emu10k1/p16v.c +1 -1
@@ -573,7 +573,7 @@ int snd_p16v_pcm(struct snd_emu10k1 *emu, int device) pcm->info_flags =0 ; pcm->dev_subclass =SNDRV_PCM_SUBCLASS_GENERIC_MIX ; -strcpy (pcm->name,"p16v" ); +strscpy (pcm->name,"p16v" ); emu->pcm_p16v = pcm; emu->p16v_interrupt = snd_p16v_interrupt;
sound/pci/emu10k1/timer.c +1 -1
@@ -80,7 +80,7 @@ int snd_emu10k1_timer(struct snd_emu10k1 *emu, int device) tid.subdevice =0 ; err =snd_timer_new (emu->card,"EMU10K1" , &tid, &timer);if (err >=0 ) { -strcpy (timer->name,"EMU10K1 timer" ); +strscpy (timer->name,"EMU10K1 timer" ); timer->private_data = emu; timer->hw = snd_emu10k1_timer_hw; }
Signature · 1 line
2.50.0
PATCH 62/103 ALSA: ens1370: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/ens1370.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
sound/pci/ens1370.c +5 -5
@@ -1244,7 +1244,7 @@ static int snd_ensoniq_pcm(struct ensoniq *ensoniq, int device) pcm->private_data = ensoniq; pcm->info_flags =0 ; -strcpy (pcm->name,CHIP_NAME " DAC2/ADC" ); +strscpy (pcm->name,CHIP_NAME " DAC2/ADC" ); ensoniq->pcm1 = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1276,7 +1276,7 @@ static int snd_ensoniq_pcm2(struct ensoniq *ensoniq, int device)#endif pcm->private_data = ensoniq; pcm->info_flags =0 ; -strcpy (pcm->name,CHIP_NAME " DAC1" ); +strscpy (pcm->name,CHIP_NAME " DAC1" ); ensoniq->pcm2 = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -2250,7 +2250,7 @@ static int snd_ensoniq_midi(struct ensoniq *ensoniq, int device) err =snd_rawmidi_new (ensoniq->card,"ES1370/1" , device,1 ,1 , &rmidi);if (err <0 )return err; -strcpy (rmidi->name,CHIP_NAME ); +strscpy (rmidi->name,CHIP_NAME );snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_OUTPUT , &snd_ensoniq_midi_output);snd_rawmidi_set_ops (rmidi,SNDRV_RAWMIDI_STREAM_INPUT , &snd_ensoniq_midi_input); rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT |
@@ -2346,9 +2346,9 @@ static int __snd_audiopci_probe(struct pci_dev *pci,snd_ensoniq_create_gameport (ensoniq, dev); -strcpy (card->driver,DRIVER_NAME ); +strscpy (card->driver,DRIVER_NAME ); -strcpy (card->shortname,"Ensoniq AudioPCI" ); +strscpy (card->shortname,"Ensoniq AudioPCI" ); sprintf(card->longname, "%s %s at 0x%lx, irq %i", card->shortname, card->driver,
Signature · 1 line
2.50.0
PATCH 63/103 ALSA: es1938: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/es1938.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/pci/es1938.c +4 -4
@@ -982,7 +982,7 @@ static int snd_es1938_new_pcm(struct es1938 *chip, int device) pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name,"ESS Solo-1" ); +strscpy (pcm->name,"ESS Solo-1" );snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , &chip->pci->dev,64 *1024 ,64 *1024 );
@@ -1658,7 +1658,7 @@ static int snd_es1938_mixer(struct es1938 *chip) card = chip->card; -strcpy (card->mixername,"ESS Solo-1" ); +strscpy (card->mixername,"ESS Solo-1" );for (idx =0 ; idx <ARRAY_SIZE (snd_es1938_controls); idx++) {struct snd_kcontrol *kctl;
@@ -1720,8 +1720,8 @@ static int __snd_es1938_probe(struct pci_dev *pci,if (err <0 )return err; -strcpy (card->driver,"ES1938" ); -strcpy (card->shortname,"ESS ES1938 (Solo-1)" ); +strscpy (card->driver,"ES1938" ); +strscpy (card->shortname,"ESS ES1938 (Solo-1)" ); sprintf(card->longname, "%s rev %i, irq %i", card->shortname, chip->revision,
Signature · 1 line
2.50.0
PATCH 64/103 ALSA: es1968: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/es1968.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/pci/es1968.c +7 -7
@@ -1812,7 +1812,7 @@ snd_es1968_pcm(struct es1968 *chip, int device) pcm->info_flags =0 ; -strcpy (pcm->name,"ESS Maestro" ); +strscpy (pcm->name,"ESS Maestro" ); chip->pcm = pcm;
@@ -2761,16 +2761,16 @@ static int __snd_es1968_probe(struct pci_dev *pci,switch (chip->type) {case TYPE_MAESTRO2E : -strcpy (card->driver,"ES1978" ); -strcpy (card->shortname,"ESS ES1978 (Maestro 2E)" ); +strscpy (card->driver,"ES1978" ); +strscpy (card->shortname,"ESS ES1978 (Maestro 2E)" );break ;case TYPE_MAESTRO2 : -strcpy (card->driver,"ES1968" ); -strcpy (card->shortname,"ESS ES1968 (Maestro 2)" ); +strscpy (card->driver,"ES1968" ); +strscpy (card->shortname,"ESS ES1968 (Maestro 2)" );break ;case TYPE_MAESTRO : -strcpy (card->driver,"ESM1" ); -strcpy (card->shortname,"ESS Maestro 1" ); +strscpy (card->driver,"ESM1" ); +strscpy (card->shortname,"ESS Maestro 1" );break ; }
Signature · 1 line
2.50.0
PATCH 65/103 ALSA: fm801: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/fm801.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/fm801.c +3 -3
@@ -726,7 +726,7 @@ static int snd_fm801_pcm(struct fm801 *chip, int device) pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name,"FM801" ); +strscpy (pcm->name,"FM801" ); chip->pcm = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &pdev->dev,
@@ -1291,8 +1291,8 @@ static int __snd_card_fm801_probe(struct pci_dev *pci,if (err <0 )return err; -strcpy (card->driver,"FM801" ); -strcpy (card->shortname,"ForteMedia FM801-" ); +strscpy (card->driver,"FM801" ); +strscpy (card->shortname,"ForteMedia FM801-" );strcat (card->shortname, chip->multichannel ?"AU" :"AS" );sprintf (card->longname,"%s at 0x%lx, irq %i" , card->shortname, chip->port, chip->irq);
Signature · 1 line
2.50.0
PATCH 66/103 ALSA: ice1712: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/ice1712/ice1712.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/pci/ice1712/ice1712.c +7 -7
@@ -850,7 +850,7 @@ static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device) pcm->private_data = ice; pcm->info_flags =0 ; -strcpy (pcm->name,"ICE1712 consumer" ); +strscpy (pcm->name,"ICE1712 consumer" ); ice->pcm = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -875,7 +875,7 @@ static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device) pcm->private_data = ice; pcm->info_flags =0 ; -strcpy (pcm->name,"ICE1712 consumer (DS)" ); +strscpy (pcm->name,"ICE1712 consumer (DS)" ); ice->pcm_ds = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1216,7 +1216,7 @@ static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device) pcm->private_data = ice; pcm->info_flags =0 ; -strcpy (pcm->name,"ICE1712 multi" ); +strscpy (pcm->name,"ICE1712 multi" );snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , &ice->pci->dev,256 *1024 ,256 *1024 );
@@ -2559,8 +2559,8 @@ static int snd_ice1712_probe(struct pci_dev *pci,return err; ice = card->private_data; -strcpy (card->driver,"ICE1712" ); -strcpy (card->shortname,"ICEnsemble ICE1712" ); +strscpy (card->driver,"ICE1712" ); +strscpy (card->shortname,"ICEnsemble ICE1712" ); err =snd_ice1712_create (card, pci, model[dev], omni[dev], cs8427_timeout[dev], dxr_enable[dev]);
@@ -2570,9 +2570,9 @@ static int snd_ice1712_probe(struct pci_dev *pci,for (tbl = card_tables; *tbl; tbl++) {for (c = *tbl; c->subvendor; c++) {if (c->subvendor == ice->eeprom.subvendor) { -strcpy (card->shortname, c->name); +strscpy (card->shortname, c->name);if (c->driver)/* specific driver? */ -strcpy (card->driver, c->driver); +strscpy (card->driver, c->driver);if (c->chip_init) { err = c->chip_init (ice);if (err <0 )
Signature · 1 line
2.50.0
PATCH 67/103 ALSA: ice1724: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/ice1712/ice1724.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
sound/pci/ice1712/ice1724.c +9 -9
@@ -1118,7 +1118,7 @@ static int snd_vt1724_pcm_profi(struct snd_ice1712 *ice, int device) pcm->private_data = ice; pcm->info_flags =0 ; -strcpy (pcm->name,"ICE1724" ); +strscpy (pcm->name,"ICE1724" );snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , &ice->pci->dev,256 *1024 ,256 *1024 );
@@ -1313,7 +1313,7 @@ static int snd_vt1724_pcm_spdif(struct snd_ice1712 *ice, int device) pcm->private_data = ice; pcm->info_flags =0 ; -strcpy (pcm->name, name); +strscpy (pcm->name, name);snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , &ice->pci->dev,256 *1024 ,256 *1024 );
@@ -1425,7 +1425,7 @@ static int snd_vt1724_pcm_indep(struct snd_ice1712 *ice, int device) pcm->private_data = ice; pcm->info_flags =0 ; -strcpy (pcm->name,"ICE1724 Surround PCM" ); +strscpy (pcm->name,"ICE1724 Surround PCM" );snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , &ice->pci->dev,256 *1024 ,256 *1024 );
@@ -1820,7 +1820,7 @@ static int snd_vt1724_pro_internal_clock_info(struct snd_kcontrol *kcontrol, uinfo->value.enumerated.item = uinfo->value.enumerated.items -1 ;if (uinfo->value.enumerated.item >= hw_rates_count)/* ext_clock items */ -strcpy (uinfo->value.enumerated.name, +strscpy (uinfo->value.enumerated.name, ice->ext_clock_names[ uinfo->value.enumerated.item - hw_rates_count]);else
@@ -2545,8 +2545,8 @@ static int __snd_vt1724_probe(struct pci_dev *pci,return err; ice = card->private_data; -strcpy (card->driver,"ICE1724" ); -strcpy (card->shortname,"ICEnsemble ICE1724" ); +strscpy (card->driver,"ICE1724" ); +strscpy (card->shortname,"ICEnsemble ICE1724" ); err =snd_vt1724_create (card, pci, model[dev]);if (err <0 )
@@ -2557,9 +2557,9 @@ static int __snd_vt1724_probe(struct pci_dev *pci, c = ice->card_info;if (c) { -strcpy (card->shortname, c->name); +strscpy (card->shortname, c->name);if (c->driver)/* specific driver? */ -strcpy (card->driver, c->driver); +strscpy (card->driver, c->driver);if (c->chip_init) { err = c->chip_init (ice);if (err <0 )
@@ -2637,7 +2637,7 @@ static int __snd_vt1724_probe(struct pci_dev *pci,return err; ice->rmidi[0 ] = rmidi; rmidi->private_data = ice; -strcpy (rmidi->name,"ICE1724 MIDI" ); +strscpy (rmidi->name,"ICE1724 MIDI" ); rmidi->info_flags =SNDRV_RAWMIDI_INFO_OUTPUT |SNDRV_RAWMIDI_INFO_INPUT |SNDRV_RAWMIDI_INFO_DUPLEX ;
Signature · 1 line
2.50.0
PATCH 68/103 ALSA: intel8x0: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/intel8x0.c | 14 +++++++------- sound/pci/intel8x0m.c | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-)
sound/pci/intel8x0.c +7 -7
@@ -1436,7 +1436,7 @@ static int snd_intel8x0_pcm1(struct intel8x0 *chip, int device,if (rec->suffix)sprintf (name,"Intel ICH - %s" , rec->suffix);else -strcpy (name,"Intel ICH" ); +strscpy (name,"Intel ICH" ); err =snd_pcm_new (chip->card, name, device, rec->playback_ops ?1 :0 , rec->capture_ops ?1 :0 , &pcm);
@@ -1453,7 +1453,7 @@ static int snd_intel8x0_pcm1(struct intel8x0 *chip, int device,if (rec->suffix)sprintf (pcm->name,"%s - %s" , chip->card->shortname, rec->suffix);else -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcm[device] = pcm; snd_pcm_set_managed_buffer_all(pcm, intel8x0_dma_type(chip),
@@ -3118,21 +3118,21 @@ static int __snd_intel8x0_probe(struct pci_dev *pci,if (spdif_aclink <0 ) spdif_aclink =check_default_spdif_aclink (pci); -strcpy (card->driver,"ICH" ); +strscpy (card->driver,"ICH" );if (!spdif_aclink) {switch (pci_id->driver_data) {case DEVICE_NFORCE : -strcpy (card->driver,"NFORCE" ); +strscpy (card->driver,"NFORCE" );break ;case DEVICE_INTEL_ICH4 : -strcpy (card->driver,"ICH4" ); +strscpy (card->driver,"ICH4" ); } } -strcpy (card->shortname,"Intel ICH" ); +strscpy (card->shortname,"Intel ICH" );for (name = shortnames; name->id; name++) {if (pci->device == name->id) { -strcpy (card->shortname, name->s); +strscpy (card->shortname, name->s);break ; } }
sound/pci/intel8x0m.c +5 -5
@@ -678,7 +678,7 @@ static int snd_intel8x0m_pcm1(struct intel8x0m *chip, int device,if (rec->suffix)sprintf (name,"Intel ICH - %s" , rec->suffix);else -strcpy (name,"Intel ICH" ); +strscpy (name,"Intel ICH" ); err =snd_pcm_new (chip->card, name, device, rec->playback_ops ?1 :0 , rec->capture_ops ?1 :0 , &pcm);
@@ -696,7 +696,7 @@ static int snd_intel8x0m_pcm1(struct intel8x0m *chip, int device,if (rec->suffix)sprintf (pcm->name,"%s - %s" , chip->card->shortname, rec->suffix);else -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcm[device] = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1184,11 +1184,11 @@ static int __snd_intel8x0m_probe(struct pci_dev *pci,return err; chip = card->private_data; -strcpy (card->driver,"ICH-MODEM" ); -strcpy (card->shortname,"Intel ICH" ); +strscpy (card->driver,"ICH-MODEM" ); +strscpy (card->shortname,"Intel ICH" );for (name = shortnames; name->id; name++) {if (pci->device == name->id) { -strcpy (card->shortname, name->s); +strscpy (card->shortname, name->s);break ; } }
Signature · 1 line
2.50.0
PATCH 69/103 ALSA: korg1212: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/korg1212/korg1212.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/korg1212/korg1212.c +3 -3
@@ -2249,7 +2249,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci) korg1212->pcm->private_data = korg1212; korg1212->pcm->private_free = snd_korg1212_free_pcm; -strcpy (korg1212->pcm->name,"korg1212" ); +strscpy (korg1212->pcm->name,"korg1212" );snd_pcm_set_ops (korg1212->pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_korg1212_playback_ops);
@@ -2298,8 +2298,8 @@ snd_korg1212_probe(struct pci_dev *pci,if (err <0 ) goto error; -strcpy (card->driver,"korg1212" ); -strcpy (card->shortname,"korg1212" ); +strscpy (card->driver,"korg1212" ); +strscpy (card->shortname,"korg1212" );sprintf (card->longname,"%s at 0x%lx, irq %d" , card->shortname, korg1212->iomem, korg1212->irq);
Signature · 1 line
2.50.0
PATCH 70/103 ALSA: lola: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/lola/lola.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/lola/lola.c +2 -2
@@ -630,12 +630,12 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, int dev)if (err <0 )return err; -strcpy (card->driver,"Lola" ); +strscpy (card->driver,"Lola" );strscpy (card->shortname,"Digigram Lola" ,sizeof (card->shortname));snprintf (card->longname,sizeof (card->longname),"%s at 0x%lx irq %i" , card->shortname, chip->bar[0 ].addr, chip->irq); -strcpy (card->mixername, card->shortname); +strscpy (card->mixername, card->shortname);lola_irq_enable (chip);
Signature · 1 line
2.50.0
PATCH 71/103 ALSA: lx6464es: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/lx6464es/lx6464es.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/lx6464es/lx6464es.c +2 -2
@@ -814,7 +814,7 @@ static int lx_pcm_create(struct lx6464es *chip) pcm->info_flags =0 ; pcm->nonatomic = true; -strcpy (pcm->name, card_name); +strscpy (pcm->name, card_name);snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , &chip->pci->dev, size, size);
@@ -1022,7 +1022,7 @@ static int snd_lx6464es_probe(struct pci_dev *pci, goto error; } -strcpy (card->driver,"LX6464ES" ); +strscpy (card->driver,"LX6464ES" );sprintf (card->id,"LX6464ES_%02X%02X%02X" , chip->mac_address[3 ], chip->mac_address[4 ], chip->mac_address[5 ]);
Signature · 1 line
2.50.0
PATCH 72/103 ALSA: maestro3: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/maestro3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/pci/maestro3.c +4 -4
@@ -1846,7 +1846,7 @@ snd_m3_pcm(struct snd_m3 * chip, int device) pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name, chip->card->driver); +strscpy (pcm->name, chip->card->driver); chip->pcm = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -2648,14 +2648,14 @@ __snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)switch (pci->device) {case PCI_DEVICE_ID_ESS_ALLEGRO :case PCI_DEVICE_ID_ESS_ALLEGRO_1 : -strcpy (card->driver,"Allegro" ); +strscpy (card->driver,"Allegro" );break ;case PCI_DEVICE_ID_ESS_CANYON3D_2LE :case PCI_DEVICE_ID_ESS_CANYON3D_2 : -strcpy (card->driver,"Canyon3D-2" ); +strscpy (card->driver,"Canyon3D-2" );break ;default : -strcpy (card->driver,"Maestro3" ); +strscpy (card->driver,"Maestro3" );break ; }
Signature · 1 line
2.50.0
PATCH 73/103 ALSA: mixart: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/mixart/mixart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/mixart/mixart.c +3 -3
@@ -970,7 +970,7 @@ static int snd_mixart_pcm_analog(struct snd_mixart *chip) pcm->info_flags =0 ; pcm->nonatomic = true; -strcpy (pcm->name, name); +strscpy (pcm->name, name);preallocate_buffers (chip, pcm);
@@ -1004,7 +1004,7 @@ static int snd_mixart_pcm_digital(struct snd_mixart *chip) pcm->info_flags =0 ; pcm->nonatomic = true; -strcpy (pcm->name, name); +strscpy (pcm->name, name);preallocate_buffers (chip, pcm);
@@ -1330,7 +1330,7 @@ static int snd_mixart_probe(struct pci_dev *pci,return err; } -strcpy (card->driver,CARD_NAME ); +strscpy (card->driver,CARD_NAME );snprintf (card->shortname,sizeof (card->shortname),"Digigram miXart [PCM #%d]" , i); snprintf(card->longname, sizeof(card->longname),
Signature · 1 line
2.50.0
PATCH 74/103 ALSA: nm256: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/nm256/nm256.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/nm256/nm256.c +3 -3
@@ -1595,13 +1595,13 @@ static int snd_nm256_probe(struct pci_dev *pci,switch (pci->device) {case PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO : -strcpy (card->driver,"NM256AV" ); +strscpy (card->driver,"NM256AV" );break ;case PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO : -strcpy (card->driver,"NM256ZX" ); +strscpy (card->driver,"NM256ZX" );break ;case PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO : -strcpy (card->driver,"NM256XL+" ); +strscpy (card->driver,"NM256XL+" );break ;default :dev_err (&pci->dev,"invalid device id 0x%x\n" , pci->device);
Signature · 1 line
2.50.0
PATCH 75/103 ALSA: oxygen: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/oxygen/oxygen_lib.c | 6 +++--- sound/pci/oxygen/oxygen_pcm.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-)
sound/pci/oxygen/oxygen_lib.c +3 -3
@@ -655,11 +655,11 @@ static int __oxygen_pci_probe(struct pci_dev *pci, int index, char *id, chip->irq = pci->irq; card->sync_irq = chip->irq; -strcpy (card->driver, chip->model.chip); -strcpy (card->shortname, chip->model.shortname); +strscpy (card->driver, chip->model.chip); +strscpy (card->shortname, chip->model.shortname);sprintf (card->longname,"%s at %#lx, irq %i" , chip->model.longname, chip->addr, chip->irq); -strcpy (card->mixername, chip->model.chip); +strscpy (card->mixername, chip->model.chip);snd_component_add (card, chip->model.chip); err =oxygen_pcm_init (chip);
sound/pci/oxygen/oxygen_pcm.c +4 -4
@@ -697,7 +697,7 @@ int oxygen_pcm_init(struct oxygen *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &oxygen_rec_b_ops); pcm->private_data = chip; -strcpy (pcm->name,"Multichannel" ); +strscpy (pcm->name,"Multichannel" );if (outs) snd_pcm_set_managed_buffer(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream, SNDRV_DMA_TYPE_DEV,
@@ -725,7 +725,7 @@ int oxygen_pcm_init(struct oxygen *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &oxygen_rec_c_ops); pcm->private_data = chip; -strcpy (pcm->name,"Digital" ); +strscpy (pcm->name,"Digital" ); snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &chip->pci->dev, DEFAULT_BUFFER_BYTES,
@@ -755,7 +755,7 @@ int oxygen_pcm_init(struct oxygen *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &oxygen_rec_b_ops); pcm->private_data = chip; -strcpy (pcm->name, outs ?"Front Panel" :"Analog 2" ); +strscpy (pcm->name, outs ?"Front Panel" :"Analog 2" ); snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &chip->pci->dev, DEFAULT_BUFFER_BYTES,
@@ -773,7 +773,7 @@ int oxygen_pcm_init(struct oxygen *chip)OXYGEN_REC_C_ROUTE_I2S_ADC_3 , OXYGEN_REC_C_ROUTE_MASK); pcm->private_data = chip; -strcpy (pcm->name,"Analog 3" ); +strscpy (pcm->name,"Analog 3" ); snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &chip->pci->dev, DEFAULT_BUFFER_BYTES,
Signature · 1 line
2.50.0
PATCH 76/103 ALSA: pcxhr: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/pcxhr/pcxhr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/pcxhr/pcxhr.c +2 -2
@@ -1149,7 +1149,7 @@ int pcxhr_create_pcm(struct snd_pcxhr *chip) pcm->info_flags =0 ; pcm->nonatomic = true; -strcpy (pcm->name, name); +strscpy (pcm->name, name); snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &chip->mgr->pci->dev,
@@ -1605,7 +1605,7 @@ static int pcxhr_probe(struct pci_dev *pci,return err; } -strcpy (card->driver,DRIVER_NAME ); +strscpy (card->driver,DRIVER_NAME );snprintf (card->shortname,sizeof (card->shortname),"Digigram [PCM #%d]" , i); snprintf(card->longname, sizeof(card->longname),
Signature · 1 line
2.50.0
PATCH 77/103 ALSA: riptide: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/riptide/riptide.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/riptide/riptide.c +3 -3
@@ -1688,7 +1688,7 @@ static int snd_riptide_pcm(struct snd_riptide *chip, int device) &snd_riptide_capture_ops); pcm->private_data = chip; pcm->info_flags =0 ; -strcpy (pcm->name,"RIPTIDE" ); +strscpy (pcm->name,"RIPTIDE" ); chip->pcm = pcm;snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV_SG , &chip->pci->dev,64 *1024 ,128 *1024 );
@@ -2098,8 +2098,8 @@ __snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id }#endif -strcpy (card->driver,"RIPTIDE" ); -strcpy (card->shortname,"Riptide" ); +strscpy (card->driver,"RIPTIDE" ); +strscpy (card->shortname,"Riptide" );#ifdef SUPPORT_JOYSTICK scnprintf(card->longname, sizeof(card->longname), "%s at 0x%lx, irq %i mpu 0x%x opl3 0x%x gameport 0x%x",
Signature · 1 line
2.50.0
PATCH 78/103 ALSA: rme32: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/rme32.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
sound/pci/rme32.c +6 -6
@@ -1314,7 +1314,7 @@ static int snd_rme32_create(struct rme32 *rme32)return err; rme32->spdif_pcm->private_data = rme32; rme32->spdif_pcm->private_free = snd_rme32_free_spdif_pcm; -strcpy (rme32->spdif_pcm->name,"Digi32 IEC958" ); +strscpy (rme32->spdif_pcm->name,"Digi32 IEC958" );if (rme32->fullduplex_mode) {snd_pcm_set_ops (rme32->spdif_pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_rme32_playback_spdif_fd_ops);
@@ -1344,7 +1344,7 @@ static int snd_rme32_create(struct rme32 *rme32)return err; rme32->adat_pcm->private_data = rme32; rme32->adat_pcm->private_free = snd_rme32_free_adat_pcm; -strcpy (rme32->adat_pcm->name,"Digi32 ADAT" ); +strscpy (rme32->adat_pcm->name,"Digi32 ADAT" );if (rme32->fullduplex_mode) {snd_pcm_set_ops (rme32->adat_pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_rme32_playback_adat_fd_ops);
@@ -1879,16 +1879,16 @@ __snd_rme32_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)if (err <0 )return err; -strcpy (card->driver,"Digi32" ); +strscpy (card->driver,"Digi32" );switch (rme32->pci->device) {case PCI_DEVICE_ID_RME_DIGI32 : -strcpy (card->shortname,"RME Digi32" ); +strscpy (card->shortname,"RME Digi32" );break ;case PCI_DEVICE_ID_RME_DIGI32_8 : -strcpy (card->shortname,"RME Digi32/8" ); +strscpy (card->shortname,"RME Digi32/8" );break ;case PCI_DEVICE_ID_RME_DIGI32_PRO : -strcpy (card->shortname,"RME Digi32 PRO" ); +strscpy (card->shortname,"RME Digi32 PRO" );break ; } sprintf(card->longname, "%s (Rev. %d) at 0x%lx, irq %d",
Signature · 1 line
2.50.0
PATCH 79/103 ALSA: rme96: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/rme96.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
sound/pci/rme96.c +8 -8
@@ -1607,7 +1607,7 @@ snd_rme96_create(struct rme96 *rme96) rme96->spdif_pcm->private_data = rme96; rme96->spdif_pcm->private_free = snd_rme96_free_spdif_pcm; -strcpy (rme96->spdif_pcm->name,"Digi96 IEC958" ); +strscpy (rme96->spdif_pcm->name,"Digi96 IEC958" );snd_pcm_set_ops (rme96->spdif_pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_rme96_playback_spdif_ops);snd_pcm_set_ops (rme96->spdif_pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_rme96_capture_spdif_ops);
@@ -1624,7 +1624,7 @@ snd_rme96_create(struct rme96 *rme96)return err; rme96->adat_pcm->private_data = rme96; rme96->adat_pcm->private_free = snd_rme96_free_adat_pcm; -strcpy (rme96->adat_pcm->name,"Digi96 ADAT" ); +strscpy (rme96->adat_pcm->name,"Digi96 ADAT" );snd_pcm_set_ops (rme96->adat_pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_rme96_playback_adat_ops);snd_pcm_set_ops (rme96->adat_pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_rme96_capture_adat_ops);
@@ -2434,23 +2434,23 @@ __snd_rme96_probe(struct pci_dev *pci,return -ENOMEM ; } -strcpy (card->driver,"Digi96" ); +strscpy (card->driver,"Digi96" );switch (rme96->pci->device) {case PCI_DEVICE_ID_RME_DIGI96 : -strcpy (card->shortname,"RME Digi96" ); +strscpy (card->shortname,"RME Digi96" );break ;case PCI_DEVICE_ID_RME_DIGI96_8 : -strcpy (card->shortname,"RME Digi96/8" ); +strscpy (card->shortname,"RME Digi96/8" );break ;case PCI_DEVICE_ID_RME_DIGI96_8_PRO : -strcpy (card->shortname,"RME Digi96/8 PRO" ); +strscpy (card->shortname,"RME Digi96/8 PRO" );break ;case PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST :pci_read_config_byte (rme96->pci,8 , &val);if (val <5 ) { -strcpy (card->shortname,"RME Digi96/8 PAD" ); +strscpy (card->shortname,"RME Digi96/8 PAD" ); }else { -strcpy (card->shortname,"RME Digi96/8 PST" ); +strscpy (card->shortname,"RME Digi96/8 PST" ); }break ; }
Signature · 1 line
2.50.0
PATCH 80/103 ALSA: hdsp: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/rme9652/hdsp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
sound/pci/rme9652/hdsp.c +6 -6
@@ -4944,7 +4944,7 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp) hdsp->hwdep = hw; hw->private_data = hdsp; -strcpy (hw->name,"HDSP hwdep interface" ); +strscpy (hw->name,"HDSP hwdep interface" ); hw->ops.ioctl = snd_hdsp_hwdep_ioctl; hw->ops.ioctl_compat = snd_hdsp_hwdep_ioctl;
@@ -4963,7 +4963,7 @@ static int snd_hdsp_create_pcm(struct snd_card *card, struct hdsp *hdsp) hdsp->pcm = pcm; pcm->private_data = hdsp; -strcpy (pcm->name, hdsp->card_name); +strscpy (pcm->name, hdsp->card_name);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_hdsp_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_hdsp_capture_ops);
@@ -5111,7 +5111,7 @@ static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp }if (!(hdsp->state & HDSP_InitializationComplete)) { -strcpy (card->shortname,"Hammerfall DSP" ); +strscpy (card->shortname,"Hammerfall DSP" );sprintf (card->longname,"%s at 0x%lx, irq %d" , hdsp->card_name, hdsp->port, hdsp->irq);
@@ -5255,8 +5255,8 @@ static int snd_hdsp_create(struct snd_card *card,*/ pci_write_config_byte (hdsp->pci,PCI_LATENCY_TIMER ,0xFF ); -strcpy (card->driver,"H-DSP" ); -strcpy (card->mixername,"Xilinx FPGA" ); +strscpy (card->driver,"H-DSP" ); +strscpy (card->mixername,"Xilinx FPGA" );if (hdsp->firmware_rev <0xa )return -ENODEV ;
@@ -5412,7 +5412,7 @@ static int snd_hdsp_probe(struct pci_dev *pci,if (err) goto error; -strcpy (card->shortname,"Hammerfall DSP" ); +strscpy (card->shortname,"Hammerfall DSP" );sprintf (card->longname,"%s at 0x%lx, irq %d" , hdsp->card_name, hdsp->port, hdsp->irq); err =snd_card_register (card);
Signature · 1 line
2.50.0
PATCH 81/103 ALSA: hdspm: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/rme9652/hdspm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/pci/rme9652/hdspm.c +4 -4
@@ -6355,7 +6355,7 @@ static int snd_hdspm_create_hwdep(struct snd_card *card, hdspm->hwdep = hw; hw->private_data = hdspm; -strcpy (hw->name,"HDSPM hwdep interface" ); +strscpy (hw->name,"HDSPM hwdep interface" ); hw->ops.open = snd_hdspm_hwdep_dummy_op; hw->ops.ioctl = snd_hdspm_hwdep_ioctl;
@@ -6412,7 +6412,7 @@ static int snd_hdspm_create_pcm(struct snd_card *card, hdspm->pcm = pcm; pcm->private_data = hdspm; -strcpy (pcm->name, hdspm->card_name); +strscpy (pcm->name, hdspm->card_name);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_hdspm_ops);
@@ -6512,8 +6512,8 @@ static int snd_hdspm_create(struct snd_card *card,pci_read_config_word (hdspm->pci,PCI_CLASS_REVISION , &hdspm->firmware_rev); -strcpy (card->mixername,"Xilinx FPGA" ); -strcpy (card->driver,"HDSPM" ); +strscpy (card->mixername,"Xilinx FPGA" ); +strscpy (card->driver,"HDSPM" );switch (hdspm->firmware_rev) {case HDSPM_RAYDAT_REV :
Signature · 1 line
2.50.0
PATCH 82/103 ALSA: rme9652: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/rme9652/rme9652.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
sound/pci/rme9652/rme9652.c +6 -6
@@ -2364,7 +2364,7 @@ static int snd_rme9652_create_pcm(struct snd_card *card, rme9652->pcm = pcm; pcm->private_data = rme9652; -strcpy (pcm->name, rme9652->card_name); +strscpy (pcm->name, rme9652->card_name);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_rme9652_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_rme9652_capture_ops);
@@ -2447,7 +2447,7 @@ static int snd_rme9652_create(struct snd_card *card,switch (rev) {case 8 :/* original eprom */ -strcpy (card->driver,"RME9636" ); +strscpy (card->driver,"RME9636" );if (rme9652->hw_rev ==15 ) { rme9652->card_name ="RME Digi9636 (Rev 1.5)" ; }else {
@@ -2456,17 +2456,17 @@ static int snd_rme9652_create(struct snd_card *card, rme9652->ss_channels =RME9636_NCHANNELS ;break ;case 9 :/* W36_G EPROM */ -strcpy (card->driver,"RME9636" ); +strscpy (card->driver,"RME9636" ); rme9652->card_name ="RME Digi9636 (Rev G)" ; rme9652->ss_channels =RME9636_NCHANNELS ;break ;case 4 :/* W52_G EPROM */ -strcpy (card->driver,"RME9652" ); +strscpy (card->driver,"RME9652" ); rme9652->card_name ="RME Digi9652 (Rev G)" ; rme9652->ss_channels =RME9652_NCHANNELS ;break ;case 3 :/* original eprom */ -strcpy (card->driver,"RME9652" ); +strscpy (card->driver,"RME9652" );if (rme9652->hw_rev ==15 ) { rme9652->card_name ="RME Digi9652 (Rev 1.5)" ; }else {
@@ -2539,7 +2539,7 @@ static int snd_rme9652_probe(struct pci_dev *pci,if (err) goto error; -strcpy (card->shortname, rme9652->card_name); +strscpy (card->shortname, rme9652->card_name);sprintf (card->longname,"%s at 0x%lx, irq %d" , card->shortname, rme9652->port, rme9652->irq);
Signature · 1 line
2.50.0
PATCH 83/103 ALSA: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/sis7019.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/pci/sis7019.c +3 -3
@@ -868,7 +868,7 @@ static int sis_pcm_create(struct sis7019 *sis)return rc; pcm->private_data = sis; -strcpy (pcm->name,"SiS7019" ); +strscpy (pcm->name,"SiS7019" ); sis->pcm = pcm;snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &sis_playback_ops);
@@ -1348,8 +1348,8 @@ static int __snd_sis7019_probe(struct pci_dev *pci,if (rc <0 )return rc; -strcpy (card->driver,"SiS7019" ); -strcpy (card->shortname,"SiS7019" ); +strscpy (card->driver,"SiS7019" ); +strscpy (card->shortname,"SiS7019" ); rc =sis_chip_create (card, pci);if (rc)return rc;
Signature · 1 line
2.50.0
sound/pci/sis7019.c
Quoted 11 lines · Takashi Iwai
Use a safer function
strscpy()instead ofstrcpy()for copying to arrays.Only idiomatic code replacement, and no functional changes.
Signed-off-by Takashi Iwai <[email protected]>--- sound/pci/sis7019.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)sound/pci/sis7019.c +0
-0
Hi Takashi,
I think you've missed the "sis7019: " after "ALSA: " on the subject line for this one.
Regards,
Geraldo Nascimento
Quoted 27 lines
index
42b22f123fa7..3d7abcb31679100644sound/pci/sis7019.c +3
-3@@ -868,7 +868,7 @@ static int sis_pcm_create(struct sis7019 *sis)return rc; pcm->private_data = sis; -strcpy (pcm->name,"SiS7019" ); +strscpy (pcm->name,"SiS7019" ); sis->pcm = pcm;snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &sis_playback_ops);@@ -1348,8 +1348,8 @@ static int __snd_sis7019_probe(struct pci_dev *pci,if (rc <0 )return rc; -strcpy (card->driver,"SiS7019" ); -strcpy (card->shortname,"SiS7019" ); +strscpy (card->driver,"SiS7019" ); +strscpy (card->shortname,"SiS7019" ); rc =sis_chip_create (card, pci);if (rc)return rc;Signature · 1 line
2.50.0
Quoted 12 lines · Geraldo Nascimento
Quoted 10 lines · Takashi Iwai
Use a safer function
strscpy()instead ofstrcpy()for copying to arrays.Only idiomatic code replacement, and no functional changes.
Signed-off-by Takashi Iwai <[email protected]>--- sound/pci/sis7019.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 6 lines
sound/pci/sis7019.c
Quoted 1 line
sound/pci/sis7019.c +0
-0Hi Takashi,
I think you've missed the "sis7019: " after "ALSA: " on the subject line for this one.
Right, I'll correct at applying.
thanks,
Takashi
PATCH 84/103 ALSA: sonicvibes: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/sonicvibes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/pci/sonicvibes.c +4 -4
@@ -863,7 +863,7 @@ static int snd_sonicvibes_pcm(struct sonicvibes *sonic, int device) pcm->private_data = sonic; pcm->info_flags =0 ; -strcpy (pcm->name,"S3 SonicVibes" ); +strscpy (pcm->name,"S3 SonicVibes" ); sonic->pcm = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1091,7 +1091,7 @@ static int snd_sonicvibes_mixer(struct sonicvibes *sonic)if (snd_BUG_ON (!sonic || !sonic->card))return -EINVAL ; card = sonic->card; -strcpy (card->mixername,"S3 SonicVibes" ); +strscpy (card->mixername,"S3 SonicVibes" );for (idx =0 ; idx <ARRAY_SIZE (snd_sonicvibes_controls); idx++) { kctl =snd_ctl_new1 (&snd_sonicvibes_controls[idx], sonic);
@@ -1415,8 +1415,8 @@ static int __snd_sonic_probe(struct pci_dev *pci,if (err <0 )return err; -strcpy (card->driver,"SonicVibes" ); -strcpy (card->shortname,"S3 SonicVibes" ); +strscpy (card->driver,"SonicVibes" ); +strscpy (card->shortname,"S3 SonicVibes" ); sprintf(card->longname, "%s rev %i at 0x%llx, irq %i", card->shortname, sonic->revision,
Signature · 1 line
2.50.0
PATCH 85/103 ALSA: trident: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/trident/trident.c | 6 +++--- sound/pci/trident/trident_main.c | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-)
sound/pci/trident/trident.c +3 -3
@@ -88,11 +88,11 @@ static int snd_trident_probe(struct pci_dev *pci,default : str ="Unknown" ; } -strcpy (card->driver, str); +strscpy (card->driver, str);if (trident->device ==TRIDENT_DEVICE_ID_SI7018 ) { -strcpy (card->shortname,"SiS " ); +strscpy (card->shortname,"SiS " ); }else { -strcpy (card->shortname,"Trident " ); +strscpy (card->shortname,"Trident " ); }strcat (card->shortname, str); sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d",
sound/pci/trident/trident_main.c +7 -7
@@ -2137,7 +2137,7 @@ int snd_trident_pcm(struct snd_trident *trident, int device) pcm->info_flags =0 ; pcm->dev_subclass =SNDRV_PCM_SUBCLASS_GENERIC_MIX ; -strcpy (pcm->name,"Trident 4DWave" ); +strscpy (pcm->name,"Trident 4DWave" ); trident->pcm = pcm;if (trident->tlb.entries) {
@@ -2189,16 +2189,16 @@ int snd_trident_foldback_pcm(struct snd_trident *trident, int device)else snd_pcm_set_ops (foldback,SNDRV_PCM_STREAM_CAPTURE , &snd_trident_foldback_ops); foldback->info_flags =0 ; -strcpy (foldback->name,"Trident 4DWave" ); +strscpy (foldback->name,"Trident 4DWave" ); substream = foldback->streams[SNDRV_PCM_STREAM_CAPTURE ].substream; -strcpy (substream->name,"Front Mixer" ); +strscpy (substream->name,"Front Mixer" ); substream = substream->next; -strcpy (substream->name,"Reverb Mixer" ); +strscpy (substream->name,"Reverb Mixer" ); substream = substream->next; -strcpy (substream->name,"Chorus Mixer" ); +strscpy (substream->name,"Chorus Mixer" );if (num_chan ==4 ) { substream = substream->next; -strcpy (substream->name,"Second AC'97 ADC" ); +strscpy (substream->name,"Second AC'97 ADC" ); } trident->foldback = foldback;
@@ -2241,7 +2241,7 @@ int snd_trident_spdif_pcm(struct snd_trident *trident, int device)snd_pcm_set_ops (spdif,SNDRV_PCM_STREAM_PLAYBACK , &snd_trident_spdif_7018_ops); } spdif->info_flags =0 ; -strcpy (spdif->name,"Trident 4DWave IEC958" ); +strscpy (spdif->name,"Trident 4DWave IEC958" ); trident->spdif = spdif; snd_pcm_set_managed_buffer_all(spdif, SNDRV_DMA_TYPE_DEV,
Signature · 1 line
2.50.0
PATCH 86/103 ALSA: via82xx: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/via82xx.c | 20 ++++++++++---------- sound/pci/via82xx_modem.c | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-)
sound/pci/via82xx.c +10 -10
@@ -1436,7 +1436,7 @@ static int snd_via8233_pcm_new(struct via82xx *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_via8233_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_via8233_capture_ops); pcm->private_data = chip; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcms[0 ] = pcm;/* set up playbacks */ for (i =0 ; i <4 ; i++)
@@ -1461,7 +1461,7 @@ static int snd_via8233_pcm_new(struct via82xx *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_via8233_multi_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_via8233_capture_ops); pcm->private_data = chip; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcms[1 ] = pcm;/* set up playback */ init_viadev (chip, chip->multi_devno,VIA_REG_MULTPLAY_STATUS ,4 ,0 );
@@ -1504,7 +1504,7 @@ static int snd_via8233a_pcm_new(struct via82xx *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_via8233_multi_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_via8233_capture_ops); pcm->private_data = chip; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcms[0 ] = pcm;/* set up playback */ init_viadev (chip, chip->multi_devno,VIA_REG_MULTPLAY_STATUS ,4 ,0 );
@@ -1532,7 +1532,7 @@ static int snd_via8233a_pcm_new(struct via82xx *chip)return err;snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_via8233_playback_ops); pcm->private_data = chip; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcms[1 ] = pcm;/* set up playback */ init_viadev (chip, chip->playback_devno,0x30 ,3 ,0 );
@@ -1562,7 +1562,7 @@ static int snd_via686_pcm_new(struct via82xx *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_via686_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_via686_capture_ops); pcm->private_data = chip; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcms[0 ] = pcm;init_viadev (chip,0 ,VIA_REG_PLAYBACK_STATUS ,0 ,0 );init_viadev (chip,1 ,VIA_REG_CAPTURE_STATUS ,0 ,1 );
@@ -2461,7 +2461,7 @@ static int __snd_via82xx_probe(struct pci_dev *pci, card_type = pci_id->driver_data;switch (card_type) {case TYPE_CARD_VIA686 : -strcpy (card->driver,"VIA686A" ); +strscpy (card->driver,"VIA686A" );sprintf (card->shortname,"VIA 82C686A/B rev%x" , pci->revision); chip_type =TYPE_VIA686 ;break ;
@@ -2471,7 +2471,7 @@ static int __snd_via82xx_probe(struct pci_dev *pci,for (i =0 ; i <ARRAY_SIZE (via823x_cards); i++) {if (pci->revision == via823x_cards[i].revision) { chip_type = via823x_cards[i].type; -strcpy (card->shortname, via823x_cards[i].name); +strscpy (card->shortname, via823x_cards[i].name);break ; } }
@@ -2487,11 +2487,11 @@ static int __snd_via82xx_probe(struct pci_dev *pci, chip_type =TYPE_VIA8233 ; }if (chip_type ==TYPE_VIA8233A ) -strcpy (card->driver,"VIA8233A" ); +strscpy (card->driver,"VIA8233A" );else if (pci->revision >=VIA_REV_8237 ) -strcpy (card->driver,"VIA8237" );/* no slog assignment */ +strscpy (card->driver,"VIA8237" );/* no slog assignment */ else -strcpy (card->driver,"VIA8233" ); +strscpy (card->driver,"VIA8233" );break ;default :dev_err (card->dev,"invalid card type %d\n" , card_type);
sound/pci/via82xx_modem.c +2 -2
@@ -842,7 +842,7 @@ static int snd_via686_pcm_new(struct via82xx_modem *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_via686_capture_ops); pcm->dev_class =SNDRV_PCM_CLASS_MODEM ; pcm->private_data = chip; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcms[0 ] = pcm;init_viadev (chip,0 ,VIA_REG_MO_STATUS ,0 );init_viadev (chip,1 ,VIA_REG_MI_STATUS ,1 );
@@ -1116,7 +1116,7 @@ static int __snd_via82xx_probe(struct pci_dev *pci, card_type = pci_id->driver_data;switch (card_type) {case TYPE_CARD_VIA82XX_MODEM : -strcpy (card->driver,"VIA82XX-MODEM" ); +strscpy (card->driver,"VIA82XX-MODEM" );sprintf (card->shortname,"VIA 82XX modem" );break ;default :
Signature · 1 line
2.50.0
PATCH 87/103 ALSA: ymfpci: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pci/ymfpci/ymfpci.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
sound/pci/ymfpci/ymfpci.c +1 -1
@@ -188,7 +188,7 @@ static int __snd_card_ymfpci_probe(struct pci_dev *pci,default : model = str ="???" ;break ; } -strcpy (card->driver, str); +strscpy (card->driver, str);sprintf (card->shortname,"Yamaha %s (%s)" , model, str); sprintf(card->longname, "%s at 0x%lx, irq %i", card->shortname,
sound/pci/ymfpci/ymfpci_main.c +4 -4
@@ -1134,7 +1134,7 @@ int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device)/* global setup */ pcm->info_flags =0 ; -strcpy (pcm->name,"YMFPCI" ); +strscpy (pcm->name,"YMFPCI" ); chip->pcm = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1201,7 +1201,7 @@ int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device)/* global setup */ pcm->info_flags =0 ; -strcpy (pcm->name,"YMFPCI - IEC958" ); +strscpy (pcm->name,"YMFPCI - IEC958" ); chip->pcm_spdif = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1242,7 +1242,7 @@ int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device)/* global setup */ pcm->info_flags =0 ; -strcpy (pcm->name,"YMFPCI - Rear PCM" ); +strscpy (pcm->name,"YMFPCI - Rear PCM" ); chip->pcm_4ch = pcm; snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -1948,7 +1948,7 @@ int snd_ymfpci_timer(struct snd_ymfpci *chip, int device) tid.subdevice =0 ; err =snd_timer_new (chip->card,"YMFPCI" , &tid, &timer);if (err >=0 ) { -strcpy (timer->name,"YMFPCI timer" ); +strscpy (timer->name,"YMFPCI timer" ); timer->private_data = chip; timer->hw = snd_ymfpci_timer_hw; }
Signature · 1 line
2.50.0
PATCH 88/103 ALSA: pdaudiocf: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pcmcia/pdaudiocf/pdaudiocf.c | 2 +- sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/pcmcia/pdaudiocf/pdaudiocf.c +1 -1
@@ -160,7 +160,7 @@ static int snd_pdacf_assign_resources(struct snd_pdacf *pdacf, int port, int irqif (err <0 )return err; -strcpy (card->driver,"PDAudio-CF" ); +strscpy (card->driver,"PDAudio-CF" );sprintf (card->shortname,"Core Sound %s" , card->driver);sprintf (card->longname,"%s at 0x%x, irq %i" , card->shortname, port, irq);
sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c +1 -1
@@ -263,7 +263,7 @@ int snd_pdacf_pcm_new(struct snd_pdacf *chip) pcm->private_data = chip; pcm->info_flags =0 ; pcm->nonatomic = true; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcm = pcm; err =snd_ak4117_build (chip->ak4117, pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream);
Signature · 1 line
2.50.0
PATCH 89/103 ALSA: vxpocket: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/pcmcia/vx/vxpocket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pcmcia/vx/vxpocket.c +1 -1
@@ -187,7 +187,7 @@ static int vxpocket_config(struct pcmcia_device *link)/* overwrite the hardware information */ chip->hw = &vxp440_hw; chip->type = vxp440_hw.type; -strcpy (chip->card->driver, vxp440_hw.name); +strscpy (chip->card->driver, vxp440_hw.name); } ret =pcmcia_request_io (link);
Signature · 1 line
2.50.0
PATCH 90/103 ALSA: ppc: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/ppc/awacs.c | 2 +- sound/ppc/burgundy.c | 2 +- sound/ppc/daca.c | 2 +- sound/ppc/pmac.c | 2 +- sound/ppc/powermac.c | 8 ++++---- sound/ppc/snd_ps3.c | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-)
sound/ppc/awacs.c +1 -1
@@ -956,7 +956,7 @@ snd_pmac_awacs_init(struct snd_pmac *chip)/* * build mixers */ -strcpy (chip->card->mixername,"PowerMac AWACS" ); +strscpy (chip->card->mixername,"PowerMac AWACS" ); err =build_mixers (chip,ARRAY_SIZE (snd_pmac_awacs_mixers), snd_pmac_awacs_mixers);
sound/ppc/burgundy.c +1 -1
@@ -665,7 +665,7 @@ int snd_pmac_burgundy_init(struct snd_pmac *chip)/* * build burgundy mixers */ -strcpy (chip->card->mixername,"PowerMac Burgundy" ); +strscpy (chip->card->mixername,"PowerMac Burgundy" );for (i =0 ; i <ARRAY_SIZE (snd_pmac_burgundy_mixers); i++) { err = snd_ctl_add(chip->card,
sound/ppc/daca.c +1 -1
@@ -261,7 +261,7 @@ int snd_pmac_daca_init(struct snd_pmac *chip)/* * build mixers */ -strcpy (chip->card->mixername,"PowerMac DACA" ); +strscpy (chip->card->mixername,"PowerMac DACA" );for (i =0 ; i <ARRAY_SIZE (daca_mixers); i++) { err =snd_ctl_add (chip->card,snd_ctl_new1 (&daca_mixers[i], chip));
sound/ppc/pmac.c +1 -1
@@ -679,7 +679,7 @@ int snd_pmac_pcm_new(struct snd_pmac *chip) pcm->private_data = chip; pcm->info_flags =SNDRV_PCM_INFO_JOINT_DUPLEX ; -strcpy (pcm->name, chip->card->shortname); +strscpy (pcm->name, chip->card->shortname); chip->pcm = pcm; chip->formats_ok =SNDRV_PCM_FMTBIT_S16_BE ;
sound/ppc/powermac.c +4 -4
@@ -55,8 +55,8 @@ static int snd_pmac_probe(struct platform_device *devptr)switch (chip->model) {case PMAC_BURGUNDY : -strcpy (card->driver,"PMac Burgundy" ); -strcpy (card->shortname,"PowerMac Burgundy" ); +strscpy (card->driver,"PMac Burgundy" ); +strscpy (card->shortname,"PowerMac Burgundy" );sprintf (card->longname,"%s (Dev %d) Sub-frame %d" , card->shortname, chip->device_id, chip->subframe); err =snd_pmac_burgundy_init (chip);
@@ -64,8 +64,8 @@ static int snd_pmac_probe(struct platform_device *devptr) goto __error;break ;case PMAC_DACA : -strcpy (card->driver,"PMac DACA" ); -strcpy (card->shortname,"PowerMac DACA" ); +strscpy (card->driver,"PMac DACA" ); +strscpy (card->shortname,"PowerMac DACA" );sprintf (card->longname,"%s (Dev %d) Sub-frame %d" , card->shortname, chip->device_id, chip->subframe); err =snd_pmac_daca_init (chip);
sound/ppc/snd_ps3.c +4 -4
@@ -951,9 +951,9 @@ static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)if (ret <0 ) goto clean_irq; -strcpy (the_card.card->driver,"PS3" ); -strcpy (the_card.card->shortname,"PS3" ); -strcpy (the_card.card->longname,"PS3 sound" ); +strscpy (the_card.card->driver,"PS3" ); +strscpy (the_card.card->shortname,"PS3" ); +strscpy (the_card.card->longname,"PS3 sound" );/* create control elements */ for (i =0 ; i <ARRAY_SIZE (spdif_ctls); i++) {
@@ -975,7 +975,7 @@ static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev) goto clean_card; the_card.pcm->private_data = &the_card; -strcpy (the_card.pcm->name,"SPDIF" ); +strscpy (the_card.pcm->name,"SPDIF" );/* set pcm ops */ snd_pcm_set_ops(the_card.pcm, SNDRV_PCM_STREAM_PLAYBACK,
Signature · 1 line
2.50.0
PATCH 91/103 ALSA: sh: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/sh/aica.c | 8 ++++---- sound/sh/sh_dac_audio.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-)
sound/sh/aica.c +4 -4
@@ -424,7 +424,7 @@ static int __init snd_aicapcmchip(struct snd_card_aicaif (unlikely (err <0 ))return err; pcm->private_data = dreamcastcard; -strcpy (pcm->name,"AICA PCM" ); +strscpy (pcm->name,"AICA PCM" );snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_aicapcm_playback_ops);/* Allocate the DMA buffers */
@@ -568,9 +568,9 @@ static int snd_aica_probe(struct platform_device *devptr)kfree (dreamcastcard);return err; } -strcpy (dreamcastcard->card->driver,"snd_aica" ); -strcpy (dreamcastcard->card->shortname,SND_AICA_DRIVER ); -strcpy (dreamcastcard->card->longname, +strscpy (dreamcastcard->card->driver,"snd_aica" ); +strscpy (dreamcastcard->card->shortname,SND_AICA_DRIVER ); +strscpy (dreamcastcard->card->longname,"Yamaha AICA Super Intelligent Sound Processor for SEGA Dreamcast" );/* Prepare to use the queue */ INIT_WORK (&(dreamcastcard->spu_dma_work), run_spu_dma);
sound/sh/sh_dac_audio.c +3 -3
@@ -224,7 +224,7 @@ static int snd_sh_dac_pcm(struct snd_sh_dac *chip, int device)return err; pcm->private_data = chip; -strcpy (pcm->name,"SH_DAC PCM" ); +strscpy (pcm->name,"SH_DAC PCM" );snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_sh_dac_pcm_ops);/* buffer size=48K */
@@ -358,8 +358,8 @@ static int snd_sh_dac_probe(struct platform_device *devptr)if (err <0 ) goto probe_error; -strcpy (card->driver,"snd_sh_dac" ); -strcpy (card->shortname,"SuperH DAC audio driver" ); +strscpy (card->driver,"snd_sh_dac" ); +strscpy (card->shortname,"SuperH DAC audio driver" );dev_info (&devptr->dev,"%s %s\n" , card->longname, card->shortname); err =snd_card_register (card);
Signature · 1 line
2.50.0
PATCH 92/103 ALSA: sparc: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/sparc/cs4231.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/sparc/cs4231.c +7 -7
@@ -1230,7 +1230,7 @@ static int snd_cs4231_pcm(struct snd_card *card)/* global setup */ pcm->private_data = chip; pcm->info_flags =SNDRV_PCM_INFO_JOINT_DUPLEX ; -strcpy (pcm->name,"CS4231" ); +strscpy (pcm->name,"CS4231" );snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , &chip->op->dev,64 *1024 ,128 *1024 );
@@ -1256,7 +1256,7 @@ static int snd_cs4231_timer(struct snd_card *card) err =snd_timer_new (card,"CS4231" , &tid, &timer);if (err <0 )return err; -strcpy (timer->name,"CS4231" ); +strscpy (timer->name,"CS4231" ); timer->private_data = chip; timer->hw = snd_cs4231_timer_table; chip->timer = timer;
@@ -1530,7 +1530,7 @@ static int snd_cs4231_mixer(struct snd_card *card)if (snd_BUG_ON (!chip || !chip->pcm))return -EINVAL ; -strcpy (card->mixername, chip->pcm->name); +strscpy (card->mixername, chip->pcm->name);for (idx =0 ; idx <ARRAY_SIZE (snd_cs4231_controls); idx++) { err = snd_ctl_add(card,
@@ -1565,8 +1565,8 @@ static int cs4231_attach_begin(struct platform_device *op,if (err <0 )return err; -strcpy (card->driver,"CS4231" ); -strcpy (card->shortname,"Sun CS4231" ); +strscpy (card->driver,"CS4231" ); +strscpy (card->shortname,"Sun CS4231" ); chip = card->private_data; chip->card = card;
@@ -1964,12 +1964,12 @@ static int snd_cs4231_ebus_create(struct snd_card *card, chip->op = op;memcpy (&chip->image, &snd_cs4231_original_image,sizeof (snd_cs4231_original_image)); -strcpy (chip->c_dma.ebus_info.name,"cs4231(capture)" ); +strscpy (chip->c_dma.ebus_info.name,"cs4231(capture)" ); chip->c_dma.ebus_info.flags =EBUS_DMA_FLAG_USE_EBDMA_HANDLER ; chip->c_dma.ebus_info.callback = snd_cs4231_ebus_capture_callback; chip->c_dma.ebus_info.client_cookie = chip; chip->c_dma.ebus_info.irq = op->archdata.irqs[0 ]; -strcpy (chip->p_dma.ebus_info.name,"cs4231(play)" ); +strscpy (chip->p_dma.ebus_info.name,"cs4231(play)" ); chip->p_dma.ebus_info.flags =EBUS_DMA_FLAG_USE_EBDMA_HANDLER ; chip->p_dma.ebus_info.callback = snd_cs4231_ebus_play_callback; chip->p_dma.ebus_info.client_cookie = chip;
Signature · 1 line
2.50.0
PATCH 93/103 ALSA: spi: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/spi/at73c213.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/spi/at73c213.c +4 -4
@@ -336,7 +336,7 @@ static int snd_at73c213_pcm_new(struct snd_at73c213 *chip, int device) pcm->private_data = chip; pcm->info_flags =SNDRV_PCM_INFO_BLOCK_TRANSFER ; -strcpy (pcm->name,"at73c213" ); +strscpy (pcm->name,"at73c213" ); chip->pcm = pcm;snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &at73c213_playback_ops);
@@ -713,7 +713,7 @@ static int snd_at73c213_mixer(struct snd_at73c213 *chip) card = chip->card; -strcpy (card->mixername, chip->pcm->name); +strscpy (card->mixername, chip->pcm->name);for (idx =0 ; idx <ARRAY_SIZE (snd_at73c213_controls); idx++) { errval = snd_ctl_add(card,
@@ -983,8 +983,8 @@ static int snd_at73c213_probe(struct spi_device *spi)if (retval) goto out_ssc; -strcpy (card->driver,"at73c213" ); -strcpy (card->shortname, board->shortname); +strscpy (card->driver,"at73c213" ); +strscpy (card->shortname, board->shortname);sprintf (card->longname,"%s on irq %d" , card->shortname, chip->irq); retval =snd_card_register (card);
Signature · 1 line
2.50.0
PATCH 94/103 ALSA: synth: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/synth/emux/emux_hwdep.c | 2 +- sound/synth/emux/emux_oss.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/synth/emux/emux_hwdep.c +1 -1
@@ -121,7 +121,7 @@ snd_emux_init_hwdep(struct snd_emux *emu)if (err <0 )return err; emu->hwdep = hw; -strcpy (hw->name,SNDRV_EMUX_HWDEP_NAME ); +strscpy (hw->name,SNDRV_EMUX_HWDEP_NAME ); hw->iface =SNDRV_HWDEP_IFACE_EMUX_WAVETABLE ; hw->ops.ioctl = snd_emux_hwdep_ioctl;/* The ioctl parameter types are compatible between 32- and
sound/synth/emux/emux_oss.c +1 -1
@@ -60,7 +60,7 @@ snd_emux_init_seq_oss(struct snd_emux *emu)return ; emu->oss_synth = dev; -strcpy (dev->name, emu->name); +strscpy (dev->name, emu->name); arg =SNDRV_SEQ_DEVICE_ARGPTR (dev); arg->type =SYNTH_TYPE_SAMPLE ; arg->subtype =SAMPLE_TYPE_AWE32 ;
Signature · 1 line
2.50.0
PATCH 95/103 ALSA: 6fire: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/usb/6fire/chip.c | 4 ++-- sound/usb/6fire/midi.c | 2 +- sound/usb/6fire/pcm.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
sound/usb/6fire/chip.c +2 -2
@@ -125,8 +125,8 @@ static int usb6fire_chip_probe(struct usb_interface *intf,dev_err (&intf->dev,"cannot create alsa card.\n" );return ret; } -strcpy (card->driver,"6FireUSB" ); -strcpy (card->shortname,"TerraTec DMX6FireUSB" ); +strscpy (card->driver,"6FireUSB" ); +strscpy (card->shortname,"TerraTec DMX6FireUSB" );sprintf (card->longname,"%s at %d:%d" , card->shortname, device->bus->busnum, device->devnum);
sound/usb/6fire/midi.c +1 -1
@@ -183,7 +183,7 @@ int usb6fire_midi_init(struct sfire_chip *chip)return ret; } rt->instance->private_data = rt; -strcpy (rt->instance->name,"DMX6FireUSB MIDI" ); +strscpy (rt->instance->name,"DMX6FireUSB MIDI" ); rt->instance->info_flags =SNDRV_RAWMIDI_INFO_OUTPUT |SNDRV_RAWMIDI_INFO_INPUT |SNDRV_RAWMIDI_INFO_DUPLEX ;
sound/usb/6fire/pcm.c +1 -1
@@ -640,7 +640,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip) } pcm->private_data = rt; -strcpy (pcm->name,"DMX 6Fire USB" ); +strscpy (pcm->name,"DMX 6Fire USB" );snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &pcm_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &pcm_ops);snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_VMALLOC ,NULL ,0 ,0 );
Signature · 1 line
2.50.0
PATCH 96/103 ALSA: line6: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/usb/line6/driver.c | 8 ++++---- sound/usb/line6/midi.c | 4 ++-- sound/usb/line6/pcm.c | 2 +- sound/usb/line6/toneport.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
sound/usb/line6/driver.c +4 -4
@@ -678,7 +678,7 @@ static int line6_hwdep_init(struct usb_line6 *line6) err =snd_hwdep_new (line6->card,"config" ,0 , &hwdep);if (err <0 ) goto end; -strcpy (hwdep->name,"config" ); +strscpy (hwdep->name,"config" ); hwdep->iface =SNDRV_HWDEP_IFACE_LINE6 ; hwdep->ops = hwdep_ops; hwdep->private_data = line6;
@@ -770,9 +770,9 @@ int line6_probe(struct usb_interface *interface, line6->ifcdev = &interface->dev;INIT_DELAYED_WORK (&line6->startup_work, line6_startup_work); -strcpy (card->id, properties->id); -strcpy (card->driver, driver_name); -strcpy (card->shortname, properties->name); +strscpy (card->id, properties->id); +strscpy (card->driver, driver_name); +strscpy (card->shortname, properties->name);sprintf (card->longname,"Line 6 %s at USB %s" , properties->name,dev_name (line6->ifcdev)); card->private_free = line6_destruct;
sound/usb/line6/midi.c +2 -2
@@ -228,8 +228,8 @@ static int snd_line6_new_midi(struct usb_line6 *line6,return err; rmidi = *rmidi_ret; -strcpy (rmidi->id, line6->properties->id); -strcpy (rmidi->name, line6->properties->name); +strscpy (rmidi->id, line6->properties->id); +strscpy (rmidi->name, line6->properties->name); rmidi->info_flags = SNDRV_RAWMIDI_INFO_OUTPUT |
sound/usb/line6/pcm.c +1 -1
@@ -486,7 +486,7 @@ static int snd_line6_new_pcm(struct usb_line6 *line6, struct snd_pcm **pcm_ret)if (err <0 )return err; pcm = *pcm_ret; -strcpy (pcm->name, line6->properties->name); +strscpy (pcm->name, line6->properties->name);/* set operators */ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
sound/usb/line6/toneport.c +1 -1
@@ -199,7 +199,7 @@ static int snd_toneport_source_info(struct snd_kcontrol *kcontrol,if (uinfo->value.enumerated.item >= size) uinfo->value.enumerated.item = size -1 ; -strcpy (uinfo->value.enumerated.name, +strscpy (uinfo->value.enumerated.name, toneport_source_info[uinfo->value.enumerated.item].name);return 0 ;
Signature · 1 line
2.50.0
PATCH 97/103 ALSA: usx2y: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/usb/usx2y/us122l.c | 2 +- sound/usb/usx2y/usX2Yhwdep.c | 2 +- sound/usb/usx2y/usbusx2y.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
sound/usb/usx2y/us122l.c +1 -1
@@ -495,7 +495,7 @@ static int usx2y_create_card(struct usb_device *device,init_waitqueue_head (&US122L (card)->sk.sleep);US122L (card)->is_us144 = flags &US122L_FLAG_US144 ;INIT_LIST_HEAD (&US122L (card)->midi_list); -strcpy (card->driver,"USB " NAME_ALLCAPS "" ); +strscpy (card->driver,"USB " NAME_ALLCAPS "" );sprintf (card->shortname,"TASCAM " NAME_ALLCAPS "" ); sprintf(card->longname, "%s (%x:%x if %d at %03d/%03d)", card->shortname,
sound/usb/usx2y/usX2Yhwdep.c +1 -1
@@ -102,7 +102,7 @@ static int snd_usx2y_hwdep_dsp_status(struct snd_hwdep *hw, }if (id <0 )return -ENODEV ; -strcpy (info->id, type_ids[id]); +strscpy (info->id, type_ids[id]); info->num_dsps =2 ;// 0: Prepad Data, 1: FPGA Code if (us428->chip_status &USX2Y_STAT_CHIP_INIT ) info->chip_ready =1 ;
sound/usb/usx2y/usbusx2y.c +1 -1
@@ -382,7 +382,7 @@ static int usx2y_create_card(struct usb_device *device,init_waitqueue_head (&usx2y (card)->us428ctls_wait_queue_head);mutex_init (&usx2y (card)->pcm_mutex);INIT_LIST_HEAD (&usx2y (card)->midi_list); -strcpy (card->driver,"USB " NAME_ALLCAPS "" ); +strscpy (card->driver,"USB " NAME_ALLCAPS "" );sprintf (card->shortname,"TASCAM " NAME_ALLCAPS "" ); sprintf(card->longname, "%s (%x:%x if %d at %03d/%03d)", card->shortname,
Signature · 1 line
2.50.0
PATCH 98/103 ALSA: ua101: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/usb/misc/ua101.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/usb/misc/ua101.c +3 -3
@@ -1246,8 +1246,8 @@ static int ua101_probe(struct usb_interface *interface, goto probe_error; name = usb_id->idProduct ==0x0044 ?"UA-1000" :"UA-101" ; -strcpy (card->driver,"UA-101" ); -strcpy (card->shortname, name); +strscpy (card->driver,"UA-101" ); +strscpy (card->shortname, name);usb_make_path (ua->dev, usb_path,sizeof (usb_path)); snprintf(ua->card->longname, sizeof(ua->card->longname), "EDIROL %s (serial %s), %u Hz at %s, %s speed", name,
@@ -1272,7 +1272,7 @@ static int ua101_probe(struct usb_interface *interface,if (err <0 ) goto probe_error; ua->pcm->private_data = ua; -strcpy (ua->pcm->name, name); +strscpy (ua->pcm->name, name);snd_pcm_set_ops (ua->pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_pcm_ops);snd_pcm_set_ops (ua->pcm,SNDRV_PCM_STREAM_CAPTURE , &capture_pcm_ops); snd_pcm_set_managed_buffer_all(ua->pcm, SNDRV_DMA_TYPE_VMALLOC,
Signature · 1 line
2.50.0
PATCH 99/103 ALSA: usb-audio: Use safer strscpy() instead of strcpy()
In reply to Takashi IwaiUse a safer function strscpy() instead of strcpy() for copying to arrays.
Only idiomatic code replacement, and no functional changes.
--- sound/usb/card.c | 2 +- sound/usb/midi.c | 2 +- sound/usb/mixer.c | 2 +- sound/usb/stream.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
sound/usb/card.c +1 -1
@@ -756,7 +756,7 @@ static int snd_usb_audio_create(struct usb_interface *intf, card->private_free = snd_usb_audio_free; -strcpy (card->driver,"USB-Audio" ); +strscpy (card->driver,"USB-Audio" );sprintf (component,"USB%04x:%04x" ,USB_ID_VENDOR (chip->usb_id),USB_ID_PRODUCT (chip->usb_id));snd_component_add (card, component);
sound/usb/midi.c +1 -1
@@ -2407,7 +2407,7 @@ static int snd_usbmidi_create_rawmidi(struct snd_usb_midi *umidi, out_ports, in_ports, &rmidi);if (err <0 )return err; -strcpy (rmidi->name, umidi->card->shortname); +strscpy (rmidi->name, umidi->card->shortname); rmidi->info_flags =SNDRV_RAWMIDI_INFO_OUTPUT |SNDRV_RAWMIDI_INFO_INPUT |SNDRV_RAWMIDI_INFO_DUPLEX ;
sound/usb/mixer.c +1 -1
@@ -3569,7 +3569,7 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif)struct usb_mixer_interface *mixer;int err; -strcpy (chip->card->mixername,"USB Mixer" ); +strscpy (chip->card->mixername,"USB Mixer" ); mixer =kzalloc (sizeof (*mixer),GFP_KERNEL );if (!mixer)
sound/usb/stream.c +1 -1
@@ -538,7 +538,7 @@ static int __snd_usb_add_audio_stream(struct snd_usb_audio *chip,if (chip->pcm_devs >0 )sprintf (pcm->name,"USB Audio #%d" , chip->pcm_devs);else -strcpy (pcm->name,"USB Audio" ); +strscpy (pcm->name,"USB Audio" );snd_usb_init_substream (as, stream, fp, pd);
Signature · 1 line
2.50.0
PATCH 100/103 ALSA: ac97: Copy string more safely
In reply to Takashi Iwaisnd_ac97_get_name() blindly assumes that the name buffer is large enough, but we should be more careful. Pass the max buffer length and allow trimming to the size.
Only a cosmetic safety matter, no functional changes intended.
--- sound/pci/ac97/ac97_codec.c | 19 +++++++++++-------- sound/pci/ac97/ac97_local.h | 2 +- sound/pci/ac97/ac97_proc.c | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-)
sound/pci/ac97/ac97_codec.c +11 -8
@@ -1840,7 +1840,8 @@ static const struct ac97_codec_id *look_for_codec_id(const struct ac97_codec_idreturn NULL ; } -void snd_ac97_get_name (struct snd_ac97 *ac97,unsigned int id,char *name,int modem) +void snd_ac97_get_name (struct snd_ac97 *ac97,unsigned int id,char *name, +size_t maxlen,int modem) {const struct ac97_codec_id *pid;
@@ -1852,7 +1853,7 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int mif (! pid)return ; -strcpy (name, pid->name); +strscpy (name, pid->name, maxlen);if (ac97 && pid->patch) {if ((modem && (pid->flags &AC97_MODEM_PATCH )) || (! modem && ! (pid->flags &AC97_MODEM_PATCH )))
@@ -1861,8 +1862,8 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int m pid =look_for_codec_id (snd_ac97_codec_ids, id);if (pid) { -strcat (name," " ); -strcat (name, pid->name); +strlcat (name," " , maxlen); +strlcat (name, pid->name, maxlen);if (pid->mask !=0xffffffff )sprintf (name +strlen (name)," rev %u" , id & ~pid->mask);if (ac97 && pid->patch) {
@@ -1870,8 +1871,10 @@ void snd_ac97_get_name(struct snd_ac97 *ac97, unsigned int id, char *name, int m (! modem && ! (pid->flags & AC97_MODEM_PATCH))) pid->patch(ac97); } - }else -sprintf (name +strlen (name)," id %x" , id &0xff ); + }else { +int l =strlen (name); +snprintf (name + l, maxlen - l," id %x" , id &0xff ); + } }/**
@@ -2295,8 +2298,8 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,/* additional initializations */ if (bus->ops->init) bus->ops->init (ac97); -snd_ac97_get_name (ac97, ac97->id, name, !ac97_is_audio (ac97)); -snd_ac97_get_name (NULL , ac97->id, name, !ac97_is_audio (ac97));// ac97->id might be changed in the special setup code +snd_ac97_get_name (ac97, ac97->id, name,sizeof (name), !ac97_is_audio (ac97)); +snd_ac97_get_name (NULL , ac97->id, name,sizeof (name), !ac97_is_audio (ac97));// ac97->id might be changed in the special setup code if (! ac97->build_ops) ac97->build_ops = &null_build_ops;
sound/pci/ac97/ac97_local.h +1 -1
@@ -8,7 +8,7 @@*/ void snd_ac97_get_name (struct snd_ac97 *ac97,unsigned int id,char *name, -int modem); +size_t maxlen,int modem);int snd_ac97_update_bits_nolock (struct snd_ac97 *ac97,unsigned short reg,unsigned short mask,unsigned short value);
sound/pci/ac97/ac97_proc.c +1 -1
@@ -98,7 +98,7 @@ static void snd_ac97_proc_read_main(struct snd_ac97 *ac97, struct snd_info_buffestatic const char *spdif_rates_cs4205[4 ] = {" Rate=48kHz" ," Rate=44.1kHz" ," Rate=res" ," Rate=res" };static const char *double_rate_slots[4 ] = {"10/11" ,"7/8" ,"reserved" ,"reserved" }; -snd_ac97_get_name (NULL , ac97->id, name,0 ); +snd_ac97_get_name (NULL , ac97->id, name,sizeof (name),0 );snd_iprintf (buffer,"%d-%d/%d: %s\n\n" , ac97->addr, ac97->num, subidx, name);if ((ac97->scaps &AC97_SCAP_AUDIO ) ==0 )
Signature · 1 line
2.50.0
PATCH 101/103 ALSA: cmipci: Copy string more safely
In reply to Takashi IwaiThe probe code uses sprintf() and strcat() without caring about the string buffer size. Replace with safer code.
Only a cosmetic safety matter, no functional changes intended.
--- sound/pci/cmipci.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
sound/pci/cmipci.c +6 -5
@@ -3008,11 +3008,12 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci, pci->device != PCI_DEVICE_ID_CMEDIA_CM8338B)query_chip (cm);/* added -MCx suffix for chip supporting multi-channels */ -if (cm->can_multi_ch) -sprintf (cm->card->driver +strlen (cm->card->driver), -"-MC%d" , cm->max_channels); -else if (cm->can_ac3_sw) -strcpy (cm->card->driver +strlen (cm->card->driver),"-SWIEC" ); +if (cm->can_multi_ch) { +int l =strlen (cm->card->driver); +scnprintf (cm->card->driver + l,sizeof (cm->card->driver) - l, +"-MC%d" , cm->max_channels); + }else if (cm->can_ac3_sw) +strlcat (cm->card->driver,"-SWIEC" ,sizeof (cm->card->driver)); cm->dig_status =SNDRV_PCM_DEFAULT_CON_SPDIF ; cm->dig_pcm_status =SNDRV_PCM_DEFAULT_CON_SPDIF ;
Signature · 1 line
2.50.0
PATCH 102/103 ALSA: usb-audio: Copy string more safely
In reply to Takashi IwaiReplace strcpy() and sprintf() usages in the USB audio drivers with the safer versions (strscpy() and scnprintf()) with the proper max size evaluation. Only for safety, no actual behavior change.
--- sound/usb/card.c | 11 ++++++----- sound/usb/midi2.c | 3 ++- sound/usb/mixer.c | 22 +++++++++++----------- sound/usb/mixer_scarlett.c | 31 ++++++++++++++++++------------- sound/usb/mixer_scarlett2.c | 14 ++++++++------ sound/usb/proc.c | 2 +- sound/usb/stream.c | 3 ++- 7 files changed, 48 insertions(+), 38 deletions(-)
sound/usb/card.c +6 -5
@@ -616,9 +616,10 @@ static void usb_audio_make_shortname(struct usb_device *dev, usb_string(dev, dev->descriptor.iProduct, card->shortname, sizeof(card->shortname)) <= 0) {/* no name available from anywhere, so use ID */ -sprintf (card->shortname,"USB Device %#04x:%#04x" , -USB_ID_VENDOR (chip->usb_id), -USB_ID_PRODUCT (chip->usb_id)); +scnprintf (card->shortname,sizeof (card->shortname), +"USB Device %#04x:%#04x" , +USB_ID_VENDOR (chip->usb_id), +USB_ID_PRODUCT (chip->usb_id)); }strim (card->shortname);
@@ -757,8 +758,8 @@ static int snd_usb_audio_create(struct usb_interface *intf, card->private_free = snd_usb_audio_free;strscpy (card->driver,"USB-Audio" ); -sprintf (component,"USB%04x:%04x" , -USB_ID_VENDOR (chip->usb_id),USB_ID_PRODUCT (chip->usb_id)); +scnprintf (component,sizeof (component),"USB%04x:%04x" , +USB_ID_VENDOR (chip->usb_id),USB_ID_PRODUCT (chip->usb_id));snd_component_add (card, component);usb_audio_make_shortname (dev, chip, quirk);
sound/usb/midi2.c +2 -1
@@ -1058,7 +1058,8 @@ static void set_fallback_rawmidi_names(struct snd_usb_midi2_interface *umidi)fill_ump_ep_name (ump, dev, dev->descriptor.iProduct);/* fill fallback name */ if (!*ump->info.name) -sprintf (ump->info.name,"USB MIDI %d" , rmidi->index); +scnprintf (ump->info.name,sizeof (ump->info.name), +"USB MIDI %d" , rmidi->index);/* copy as rawmidi name if not set */ if (!*ump->core.name) strscpy(ump->core.name, ump->info.name,
sound/usb/mixer.c +11 -11
@@ -674,40 +674,40 @@ static int get_term_name(struct snd_usb_audio *chip, struct usb_audio_term *iterreturn 0 ;switch (iterm->type >>16 ) {case UAC3_SELECTOR_UNIT : -strcpy (name,"Selector" ); +strscpy (name,"Selector" , maxlen);return 8 ;case UAC3_PROCESSING_UNIT : -strcpy (name,"Process Unit" ); +strscpy (name,"Process Unit" , maxlen);return 12 ;case UAC3_EXTENSION_UNIT : -strcpy (name,"Ext Unit" ); +strscpy (name,"Ext Unit" , maxlen);return 8 ;case UAC3_MIXER_UNIT : -strcpy (name,"Mixer" ); +strscpy (name,"Mixer" , maxlen);return 5 ;default : -return sprintf (name,"Unit %d" , iterm->id); +return scnprintf (name, maxlen,"Unit %d" , iterm->id); } }switch (iterm->type &0xff00 ) {case 0x0100 : -strcpy (name,"PCM" ); +strscpy (name,"PCM" , maxlen);return 3 ;case 0x0200 : -strcpy (name,"Mic" ); +strscpy (name,"Mic" , maxlen);return 3 ;case 0x0400 : -strcpy (name,"Headset" ); +strscpy (name,"Headset" , maxlen);return 7 ;case 0x0500 : -strcpy (name,"Phone" ); +strscpy (name,"Phone" , maxlen);return 5 ; }for (names = iterm_names; names->type; names++) {if (names->type == iterm->type) { -strcpy (name, names->name); +strscpy (name, names->name, maxlen);return strlen (names->name); } }
@@ -2804,7 +2804,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, len =get_term_name (state->chip, &iterm, namelist[i],MAX_ITEM_NAME_LEN ,0 );if (! len) -sprintf (namelist[i],"Input %u" , i); +scnprintf (namelist[i],MAX_ITEM_NAME_LEN ,"Input %u" , i); } kctl =snd_ctl_new1 (&mixer_selectunit_ctl, cval);
sound/usb/mixer_scarlett.c +18 -13
@@ -357,21 +357,21 @@ static int scarlett_ctl_put(struct snd_kcontrol *kctl,return changed; } -static void scarlett_generate_name (int i,char *dst,int offsets[]) +static void scarlett_generate_name (int i,char *dst,size_t size,int offsets[]) {if (i > offsets[SCARLETT_OFFSET_MIX ]) -sprintf (dst,"Mix %c" , -'A' +(i - offsets[SCARLETT_OFFSET_MIX ] -1 )); +scnprintf (dst, size,"Mix %c" , +'A' +(i - offsets[SCARLETT_OFFSET_MIX ] -1 ));else if (i > offsets[SCARLETT_OFFSET_ADAT ]) -sprintf (dst,"ADAT %d" , i - offsets[SCARLETT_OFFSET_ADAT ]); +scnprintf (dst, size,"ADAT %d" , i - offsets[SCARLETT_OFFSET_ADAT ]);else if (i > offsets[SCARLETT_OFFSET_SPDIF ]) -sprintf (dst,"SPDIF %d" , i - offsets[SCARLETT_OFFSET_SPDIF ]); +scnprintf (dst, size,"SPDIF %d" , i - offsets[SCARLETT_OFFSET_SPDIF ]);else if (i > offsets[SCARLETT_OFFSET_ANALOG ]) -sprintf (dst,"Analog %d" , i - offsets[SCARLETT_OFFSET_ANALOG ]); +scnprintf (dst, size,"Analog %d" , i - offsets[SCARLETT_OFFSET_ANALOG ]);else if (i > offsets[SCARLETT_OFFSET_PCM ]) -sprintf (dst,"PCM %d" , i - offsets[SCARLETT_OFFSET_PCM ]); +scnprintf (dst, size,"PCM %d" , i - offsets[SCARLETT_OFFSET_PCM ]);else -sprintf (dst,"Off" ); +scnprintf (dst, size,"Off" ); } static int scarlett_ctl_enum_dynamic_info(struct snd_kcontrol *kctl,
@@ -391,6 +391,7 @@ static int scarlett_ctl_enum_dynamic_info(struct snd_kcontrol *kctl,/* generate name dynamically based on item number and offset info */ scarlett_generate_name (uinfo->value.enumerated.item, uinfo->value.enumerated.name, +sizeof (uinfo->value.enumerated.name), opt->offsets);return 0 ;
@@ -876,7 +877,8 @@ static int scarlett_controls_create_generic(struct usb_mixer_interface *mixer,return err;break ;case SCARLETT_SWITCH_IMPEDANCE : -sprintf (mx,"Input %d Impedance Switch" , ctl->num); +scnprintf (mx,sizeof (mx), +"Input %d Impedance Switch" , ctl->num); err = add_new_ctl(mixer, &usb_scarlett_ctl_enum, scarlett_ctl_enum_resume, 0x01, 0x09, ctl->num, USB_MIXER_S16, 1, mx,
@@ -885,7 +887,8 @@ static int scarlett_controls_create_generic(struct usb_mixer_interface *mixer,return err;break ;case SCARLETT_SWITCH_PAD : -sprintf (mx,"Input %d Pad Switch" , ctl->num); +scnprintf (mx,sizeof (mx), +"Input %d Pad Switch" , ctl->num); err = add_new_ctl(mixer, &usb_scarlett_ctl_enum, scarlett_ctl_enum_resume, 0x01, 0x0b, ctl->num, USB_MIXER_S16, 1, mx,
@@ -894,7 +897,8 @@ static int scarlett_controls_create_generic(struct usb_mixer_interface *mixer,return err;break ;case SCARLETT_SWITCH_GAIN : -sprintf (mx,"Input %d Gain Switch" , ctl->num); +scnprintf (mx,sizeof (mx), +"Input %d Gain Switch" , ctl->num); err = add_new_ctl(mixer, &usb_scarlett_ctl_enum, scarlett_ctl_enum_resume, 0x01, 0x08, ctl->num, USB_MIXER_S16, 1, mx,
@@ -960,8 +964,9 @@ int snd_scarlett_controls_create(struct usb_mixer_interface *mixer)return err;for (o =0 ; o < info->matrix_out; o++) { -sprintf (mx,"Matrix %02d Mix %c Playback Volume" , i+1 , - o+'A' ); +scnprintf (mx,sizeof (mx), +"Matrix %02d Mix %c Playback Volume" , i+1 , + o+'A' ); err = add_new_ctl(mixer, &usb_scarlett_ctl, scarlett_ctl_resume, 0x3c, 0x00, (i << 3) + (o & 0x07), USB_MIXER_S16,
sound/usb/mixer_scarlett2.c +8 -6
@@ -7396,13 +7396,15 @@ static int scarlett2_mux_src_enum_ctl_info(struct snd_kcontrol *kctl,if (port_type ==SCARLETT2_PORT_TYPE_MIX && item >= private->num_mix_out) -sprintf (uinfo->value.enumerated.name, - port->dsp_src_descr, - item - private->num_mix_out +1 ); +scnprintf (uinfo->value.enumerated.name, +sizeof (uinfo->value.enumerated.name), + port->dsp_src_descr, + item - private->num_mix_out +1 );else -sprintf (uinfo->value.enumerated.name, - port->src_descr, - item + port->src_num_offset); +scnprintf (uinfo->value.enumerated.name, +sizeof (uinfo->value.enumerated.name), + port->src_descr, + item + port->src_num_offset);return 0 ; }
sound/usb/proc.c +1 -1
@@ -231,7 +231,7 @@ void snd_usb_proc_pcm_format_add(struct snd_usb_stream *stream)char name[32 ];struct snd_card *card = stream->chip->card; -sprintf (name,"stream%d" , stream->pcm_index); +scnprintf (name,sizeof (name),"stream%d" , stream->pcm_index);snd_card_ro_proc_new (card, name, stream, proc_pcm_format_read); }
sound/usb/stream.c +2 -1
@@ -536,7 +536,8 @@ static int __snd_usb_add_audio_stream(struct snd_usb_audio *chip, pcm->private_free = snd_usb_audio_pcm_free; pcm->info_flags =0 ;if (chip->pcm_devs >0 ) -sprintf (pcm->name,"USB Audio #%d" , chip->pcm_devs); +scnprintf (pcm->name,sizeof (pcm->name),"USB Audio #%d" , + chip->pcm_devs);else strscpy (pcm->name,"USB Audio" );
Signature · 1 line
2.50.0
PATCH 103/103 ALSA: core: Copy string more safely
In reply to Takashi IwaiReplace the remaining strcpy() and sprintf() usages in the ALSA core code with the safer versions.
The first strcpy() points actually to card->id, hence just use strscpy() with card->id instead.
The append of suffix string is slightly rewritten so that we can use scnprintf() and strscpy().
Only for safety, no actual behavior change.
--- sound/core/init.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
sound/core/init.c +7 -9
@@ -723,27 +723,25 @@ static void snd_card_set_id_no_lock(struct snd_card *card, const char *src,* ("card" conflicts with proc directories) */ if (!*id || !strncmp (id,"card" ,4 )) { -strcpy (id,"Default" ); +strscpy (card->id,"Default" ); is_default = true; } len =strlen (id);for (loops =0 ; loops <SNDRV_CARDS ; loops++) { -char *spos;char sfxstr[5 ];/* "_012" */ -int sfxlen; +int sfxlen, slen;if (card_id_ok (card, id))return ;/* OK */ /* Add _XYZ suffix */ -sprintf (sfxstr,"_%X" , loops +1 ); - sfxlen =strlen (sfxstr); + sfxlen =scnprintf (sfxstr,sizeof (sfxstr),"_%X" , loops +1 );if (len + sfxlen >=sizeof (card->id)) - spos = id +sizeof (card->id) - sfxlen -1 ; + slen =sizeof (card->id) - sfxlen -1 ;else - spos = id + len; -strcpy (spos, sfxstr); + slen = len; +strscpy (id + slen, sfxstr,sizeof (card->id) - slen); }/* fallback to the default id */ if (!is_default) {
@@ -801,7 +799,7 @@ static ssize_t id_store(struct device *dev, struct device_attribute *attr,guard (mutex)(&snd_card_mutex);if (!card_id_ok (NULL , buf1))return -EEXIST ; -strcpy (card->id, buf1); +strscpy (card->id, buf1);snd_info_card_id_change (card);return count;
Signature · 1 line
2.50.0
Hi,
Quoted 6 lines · Takashi Iwai
Hi,
this is a collection of small and pretty trivial patches to replace the
strcpy()calls withstrscpy(). Most of changes (except for a few last ones) are systematic replacement withstrscpy()where the copy is done against arrays, so pretty safe.
To the changes for ALSA firewire stack:
Thanks
Takashi Sakamoto