Skip to contentSkip to conversation

x86: check function status in EDD boot code

PATCH Applied Jan Beulich 2 participants 2 messages Jul 18, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: check function status in EDD boot code

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.

---
 arch/x86/boot/edd.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/x86/boot/edd.c +2 -3
@@ -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++;
reviewer Applied
#1 lore raw
Quoted 5 lines · Jan Beulich

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.

Applied to x86/setup, thanks.

-hpa