PATCH: further OSS audio updates

From: Alan Cox (alan_at_lxorguk.ukuu.org.uk)
Date: 07/27/03

  • Next message: Andrew de Quincey: "[PATCH] ACPI patch which fixes all my IRQ problems on nforce2 -- linux-2.5.75-acpi-irqparams-final4.patch"
    Date:	Sun, 27 Jul 2003 21:27:43 +0100
    To: linux-kernel@vger.kernel.org, torvalds@osdl.org
    
    

    diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.6.0-test2/sound/oss/ac97_codec.c linux-2.6.0-test2-ac1/sound/oss/ac97_codec.c
    --- linux-2.6.0-test2/sound/oss/ac97_codec.c 2003-07-14 14:11:57.000000000 +0100
    +++ linux-2.6.0-test2-ac1/sound/oss/ac97_codec.c 2003-07-23 16:32:08.000000000 +0100
    @@ -513,8 +513,9 @@
     
             if (cmd == SOUND_MIXER_INFO) {
                     mixer_info info;
    - strncpy(info.id, codec->name, sizeof(info.id));
    - strncpy(info.name, codec->name, sizeof(info.name));
    + memset(&info, 0, sizeof(info));
    + strlcpy(info.id, codec->name, sizeof(info.id));
    + strlcpy(info.name, codec->name, sizeof(info.name));
                     info.modify_counter = codec->modcnt;
                     if (copy_to_user((void *)arg, &info, sizeof(info)))
                             return -EFAULT;
    @@ -522,8 +523,9 @@
             }
             if (cmd == SOUND_OLD_MIXER_INFO) {
                     _old_mixer_info info;
    - strncpy(info.id, codec->name, sizeof(info.id));
    - strncpy(info.name, codec->name, sizeof(info.name));
    + memset(&info, 0, sizeof(info));
    + strlcpy(info.id, codec->name, sizeof(info.id));
    + strlcpy(info.name, codec->name, sizeof(info.name));
                     if (copy_to_user((void *)arg, &info, sizeof(info)))
                             return -EFAULT;
                     return 0;
    diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.6.0-test2/sound/oss/cmpci.c linux-2.6.0-test2-ac1/sound/oss/cmpci.c
    --- linux-2.6.0-test2/sound/oss/cmpci.c 2003-07-14 14:11:57.000000000 +0100
    +++ linux-2.6.0-test2-ac1/sound/oss/cmpci.c 2003-07-23 16:32:08.000000000 +0100
    @@ -1272,8 +1272,9 @@
             VALIDATE_STATE(s);
             if (cmd == SOUND_MIXER_INFO) {
                     mixer_info info;
    - strncpy(info.id, "cmpci", sizeof(info.id));
    - strncpy(info.name, "C-Media PCI", sizeof(info.name));
    + memset(&info, 0, sizeof(info));
    + strlcpy(info.id, "cmpci", sizeof(info.id));
    + strlcpy(info.name, "C-Media PCI", sizeof(info.name));
                     info.modify_counter = s->mix.modcnt;
                     if (copy_to_user((void *)arg, &info, sizeof(info)))
                             return -EFAULT;
    @@ -1281,8 +1282,9 @@
             }
             if (cmd == SOUND_OLD_MIXER_INFO) {
                     _old_mixer_info info;
    - strncpy(info.id, "cmpci", sizeof(info.id));
    - strncpy(info.name, "C-Media cmpci", sizeof(info.name));
    + memset(&info, 0, sizeof(info));
    + strlcpy(info.id, "cmpci", sizeof(info.id));
    + strlcpy(info.name, "C-Media cmpci", sizeof(info.name));
                     if (copy_to_user((void *)arg, &info, sizeof(info)))
                             return -EFAULT;
                     return 0;
    diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.6.0-test2/sound/oss/dmasound/dmasound_core.c linux-2.6.0-test2-ac1/sound/oss/dmasound/dmasound_core.c
    --- linux-2.6.0-test2/sound/oss/dmasound/dmasound_core.c 2003-07-27 19:56:30.000000000 +0100
    +++ linux-2.6.0-test2-ac1/sound/oss/dmasound/dmasound_core.c 2003-07-27 20:50:02.000000000 +0100
    @@ -351,8 +351,9 @@
                 case SOUND_MIXER_INFO:
                     {
                         mixer_info info;
    - strncpy(info.id, dmasound.mach.name2, sizeof(info.id));
    - strncpy(info.name, dmasound.mach.name2, sizeof(info.name));
    + memset(&info, 0, sizeof(info));
    + strlcpy(info.id, dmasound.mach.name2, sizeof(info.id));
    + strlcpy(info.name, dmasound.mach.name2, sizeof(info.name));
                         info.modify_counter = mixer.modify_counter;
                         if (copy_to_user((int *)arg, &info, sizeof(info)))
                                 return -EFAULT;
    diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.6.0-test2/sound/oss/hal2.c linux-2.6.0-test2-ac1/sound/oss/hal2.c
    --- linux-2.6.0-test2/sound/oss/hal2.c 2003-07-27 19:56:30.000000000 +0100
    +++ linux-2.6.0-test2-ac1/sound/oss/hal2.c 2003-07-23 16:32:08.000000000 +0100
    @@ -787,9 +787,9 @@
     
             if (cmd == SOUND_MIXER_INFO) {
                     mixer_info info;
    -
    - strncpy(info.id, hal2str, sizeof(info.id));
    - strncpy(info.name, hal2str, sizeof(info.name));
    + memset(&info, 0, sizeof(info));
    + strlcpy(info.id, hal2str, sizeof(info.id));
    + strlcpy(info.name, hal2str, sizeof(info.name));
                     info.modify_counter = hal2->mixer.modcnt;
                     if (copy_to_user((void *)arg, &info, sizeof(info)))
                             return -EFAULT;
    @@ -797,9 +797,9 @@
             }
             if (cmd == SOUND_OLD_MIXER_INFO) {
                     _old_mixer_info info;
    -
    - strncpy(info.id, hal2str, sizeof(info.id));
    - strncpy(info.name, hal2str, sizeof(info.name));
    + memset(&info, 0, sizeof(info));
    + strlcpy(info.id, hal2str, sizeof(info.id));
    + strlcpy(info.name, hal2str, sizeof(info.name));
                     if (copy_to_user((void *)arg, &info, sizeof(info)))
                             return -EFAULT;
                     return 0;
    diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.6.0-test2/sound/oss/harmony.c linux-2.6.0-test2-ac1/sound/oss/harmony.c
    --- linux-2.6.0-test2/sound/oss/harmony.c 2003-07-27 19:56:30.000000000 +0100
    +++ linux-2.6.0-test2-ac1/sound/oss/harmony.c 2003-07-23 15:56:03.000000000 +0100
    @@ -1296,7 +1296,6 @@
             unregister_parisc_driver(&harmony_driver);
     }
     
    -EXPORT_NO_SYMBOLS;
     
     MODULE_AUTHOR("Alex DeVries <alex@linuxcare.com>");
     MODULE_DESCRIPTION("Harmony sound driver");
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Andrew de Quincey: "[PATCH] ACPI patch which fixes all my IRQ problems on nforce2 -- linux-2.5.75-acpi-irqparams-final4.patch"

    Relevant Pages

    • Re: 2.6.5-aa1
      ... nVidia bin driver 5341 with ALSA sound driver snd_intel8x0. ... No sound daemon under my Fedora GNOME Desktop running. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • RE: Error mounting root fs on 72:01 using Promise FastTrak TX2000 (PDC20271)
      ... The Promise ataraid driver never gets loaded. ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: [RFC] EDAC and the sysfs
      ... > definitely has been a bit thin on information on sysfs ... for anyone doing any driver core stuff. ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: speedtch driver, 2.6.14.2
      ... >> resynchronize? ... Does the driver detect that the line is back up? ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: What is the SiI 0680 chipset status?
      ... I browsed through the archives and I know that the driver is ... UltraTrak 133 TX2 controller (subject: PROBLEM: Powerquest Drive ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)