Commit f2ba93929fdb91fd806be20e959a50f7db82790e
Committed by
H. Peter Anvin
1 parent
ffaa152efd
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff
arch/x86/boot/edd.c
... | ... | @@ -167,9 +167,8 @@ |
167 | 167 | * Scan the BIOS-supported hard disks and query EDD |
168 | 168 | * information... |
169 | 169 | */ |
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) { | |
173 | 172 | memcpy(edp, &ei, sizeof ei); |
174 | 173 | edp++; |
175 | 174 | boot_params.eddbuf_entries++; |