[alsa-devel] [bug report] ALSA: x86: Flatten two abstraction layers
Dan Carpenter
dan.carpenter at oracle.com
Tue Feb 7 11:42:03 CET 2017
Hello Takashi Iwai,
The patch da8648097497: "ALSA: x86: Flatten two abstraction layers"
from Jan 31, 2017, leads to the following static checker warning:
sound/x86/intel_hdmi_audio.c:1702 hdmi_lpe_audio_probe()
error: strcpy() '"IntelHdmiLpeAudio"' too large for 'card->driver' (18 vs 16)
sound/x86/intel_hdmi_audio.c
1695 ctx = card->private_data;
1696 spin_lock_init(&ctx->had_spinlock);
1697 mutex_init(&ctx->mutex);
1698 ctx->connected = false;
1699 ctx->dev = &pdev->dev;
1700 ctx->card = card;
1701 ctx->aes_bits = SNDRV_PCM_DEFAULT_CON_SPDIF;
1702 strcpy(card->driver, INTEL_HAD);
^^^^^^^^^
Too long. We're corrupting memory. The old code was equally bad, but
the renaming the function made it show up as a new warning...
1703 strcpy(card->shortname, INTEL_HAD);
1704
regards,
dan carpenter
More information about the Alsa-devel
mailing list