Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand/lib biosdisk_getextinfo() can fail. If ...



details:   https://anonhg.NetBSD.org/src/rev/c8cb8b8d939c
branches:  trunk
changeset: 762440:c8cb8b8d939c
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Mon Feb 21 00:43:19 2011 +0000

description:
biosdisk_getextinfo() can fail.  If it does fail in set_geometry(),
clear the flag BIOSDISK_INT13EXT so that a caller such as read_gpt()
will not try to rely on the gibberish in the biosdisk_extinfo.

diffstat:

 sys/arch/i386/stand/lib/biosdisk_ll.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 65a9154941c0 -r c8cb8b8d939c sys/arch/i386/stand/lib/biosdisk_ll.c
--- a/sys/arch/i386/stand/lib/biosdisk_ll.c     Mon Feb 21 00:40:07 2011 +0000
+++ b/sys/arch/i386/stand/lib/biosdisk_ll.c     Mon Feb 21 00:43:19 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: biosdisk_ll.c,v 1.29 2010/12/30 22:27:43 jakllsch Exp $         */
+/*     $NetBSD: biosdisk_ll.c,v 1.30 2011/02/21 00:43:19 dyoung Exp $   */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -128,7 +128,8 @@
                d->flags |= BIOSDISK_INT13EXT;
                if (ed != NULL) {
                        ed->size = sizeof(*ed);
-                       biosdisk_getextinfo(d->dev, ed);
+                       if (biosdisk_getextinfo(d->dev, ed) != 0)
+                               d->flags &= ~BIOSDISK_INT13EXT;
                }
        }
 



Home | Main Index | Thread Index | Old Index