[PATCH] UEAGLE : cmv name bug (was cosmetic)
authormatthieu castet <castet.matthieu@free.fr>
Wed, 18 Jan 2006 06:39:27 +0000 (07:39 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 1 Feb 2006 01:23:41 +0000 (17:23 -0800)
this patch correct a possible bug with cmv_name being static. If there
is 2 modems and the driver is scheduled when filling cmv_name this could
result with garbage in cmv_name. We allocate cmv_name on the stack but
with a small size in order to avoid that.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/atm/ueagle-atm.c

index b0026ecc6a36eb91acc98d0b8ca9d0b2035c80b3..830d2c982670db964f0263b1958617342c3f7f85 100644 (file)
@@ -1013,7 +1013,7 @@ static int request_cmvs(struct uea_softc *sc,
        int ret, size;
        u8 *data;
        char *file;
-       static char cmv_name[256] = FW_DIR;
+       char cmv_name[FIRMWARE_NAME_MAX]; /* 30 bytes stack variable */
 
        if (cmv_file[sc->modem_index] == NULL) {
                if (UEA_CHIP_VERSION(sc) == ADI930)