x86: check function status in EDD boot code
authorJan Beulich <jbeulich@novell.com>
Fri, 18 Jul 2008 12:35:37 +0000 (13:35 +0100)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 18 Jul 2008 21:33:17 +0000 (14:33 -0700)
Without checking the return value of get_edd_info() and adding the
entry only in the success case, 6 devices show up under
/sys/firmware/edd/, no matter how many devices are actually present.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/boot/edd.c

index 03399d6..d93cbc6 100644 (file)
@@ -167,9 +167,8 @@ void query_edd(void)
                 * Scan the BIOS-supported hard disks and query EDD
                 * information...
                 */
-               get_edd_info(devno, &ei);
-
-               if (boot_params.eddbuf_entries < EDDMAXNR) {
+               if (!get_edd_info(devno, &ei)
+                   && boot_params.eddbuf_entries < EDDMAXNR) {
                        memcpy(edp, &ei, sizeof ei);
                        edp++;
                        boot_params.eddbuf_entries++;