Pārlūkot izejas kodu

[PATCH] UEAGLE : cmv name bug (was cosmetic)

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>
matthieu castet 19 gadi atpakaļ
vecāks
revīzija
fdf290fd6d
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      drivers/usb/atm/ueagle-atm.c

+ 1 - 1
drivers/usb/atm/ueagle-atm.c

@@ -1013,7 +1013,7 @@ static int request_cmvs(struct uea_softc *sc,
 	int ret, size;
 	int ret, size;
 	u8 *data;
 	u8 *data;
 	char *file;
 	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 (cmv_file[sc->modem_index] == NULL) {
 		if (UEA_CHIP_VERSION(sc) == ADI930)
 		if (UEA_CHIP_VERSION(sc) == ADI930)