Skip to content

Commit

Permalink
x86: check function status in EDD boot code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Beulich authored and H. Peter Anvin committed Jul 18, 2008
1 parent ffaa152 commit f2ba939
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arch/x86/boot/edd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit f2ba939

Please sign in to comment.