Re: [PATCH] ide: fix revision comparison in ide_in_drive_list

From: Andrew Morton
Date: Tue Jun 20 2006 - 18:15:30 EST


Kirill Smelkov <kirr@xxxxxxxxxx> wrote:
>
> NB: bart/ide-2.6.git seems to be unmaintained, so I'm sending this directly to -mm
>
> Fix ide_in_drive_list: drive_table->id_firmware should be searched *in* id->fw_rev,
> not vise versa.
>
> Signed-off-by: Kirill Smelkov <kirr@xxxxxxxxxx>
>
> Index: linux-2.6.17/drivers/ide/ide-dma.c
> ===================================================================
> --- linux-2.6.17.orig/drivers/ide/ide-dma.c 2006-06-20 13:51:49.000000000 +0400
> +++ linux-2.6.17/drivers/ide/ide-dma.c 2006-06-20 13:52:14.000000000 +0400
> @@ -147,7 +147,7 @@
> {
> for ( ; drive_table->id_model ; drive_table++)
> if ((!strcmp(drive_table->id_model, id->model)) &&
> - ((strstr(drive_table->id_firmware, id->fw_rev)) ||
> + ((strstr(id->fw_rev, drive_table->id_firmware)) ||
> (!strcmp(drive_table->id_firmware, "ALL"))))
> return 1;
> return 0;

hm. This seems... rather serious. I assume that in most cases, the
firmware rev which we have in the table (eg "24.09P07") is a full-string
match for the string which the drive returned.

If not, you've just blacklisted a whole bunch of drives which always should
have been blacklisted, but weren't.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/