Skip to content

Commit f2ba939

Browse files
Jan BeulichH. Peter Anvin
authored andcommitted
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. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
1 parent ffaa152 commit f2ba939

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/x86/boot/edd.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,8 @@ void query_edd(void)
167167
* Scan the BIOS-supported hard disks and query EDD
168168
* information...
169169
*/
170-
get_edd_info(devno, &ei);
171-
172-
if (boot_params.eddbuf_entries < EDDMAXNR) {
170+
if (!get_edd_info(devno, &ei)
171+
&& boot_params.eddbuf_entries < EDDMAXNR) {
173172
memcpy(edp, &ei, sizeof ei);
174173
edp++;
175174
boot_params.eddbuf_entries++;

0 commit comments

Comments
 (0)