hdt: Fixing crash on some optical drives
authorErwan Velu <erwan.velu@free.fr>
Tue, 24 Mar 2009 21:43:07 +0000 (22:43 +0100)
committerErwan Velu <erwan.velu@free.fr>
Thu, 26 Mar 2009 17:27:23 +0000 (18:27 +0100)
Impact: Prevent some hard crashes

On some optical drives, requesting int 13, func 0x48 make the system
crash. In fact, if the geometry isn't valid (optical drives), no need to
check for extended attributes

com32/hdt/hdt-ata.c

index 4e3ea43..eb507d2 100644 (file)
@@ -196,6 +196,10 @@ int get_disk_params(int disk, struct diskinfo *disk_info)
     disk_info[disk].cbios = 1;  /* Valid geometry */
   }
 
+  /* If geometry isn't valid, no need to try to get more info about the drive*/
+  /* Looks like in can confuse some optical drives */
+  if (disk_info[disk].cbios != 1) return 0;
+
 /* FIXME: memset to 0 make it fails
  * memset(__com32.cs_bounce, 0, sizeof(struct device_pairameter)); */
   memset(&dp, 0, sizeof(struct device_parameter));