Mercurial > illumos > illumos-gate
changeset 9811:32bf28cecf9f
6425762 Kernel panic (divide by 0) when blank cd inserted into USB cdburner Sol 10x86 upd1 on Satellite A30
author | Sheshadri Vasudevan <Sheshadri.Vasudevan@Sun.COM> |
---|---|
date | Mon, 08 Jun 2009 15:32:25 +0530 |
parents | 0bddf3c4f9fb |
children | a2990074321f |
files | usr/src/uts/common/io/cmlb.c |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/common/io/cmlb.c Sun Jun 07 23:28:14 2009 -0700 +++ b/usr/src/uts/common/io/cmlb.c Mon Jun 08 15:32:25 2009 +0530 @@ -1827,7 +1827,10 @@ spc = pgeomp->g_nhead * pgeomp->g_nsect; pgeomp->g_capacity = capacity; - pgeomp->g_ncyl = pgeomp->g_capacity / spc; + if (spc == 0) + pgeomp->g_ncyl = 0; + else + pgeomp->g_ncyl = pgeomp->g_capacity / spc; pgeomp->g_acyl = 0; /* @@ -2815,7 +2818,8 @@ phys_spc = cl->cl_g.dkg_nhead * cl->cl_g.dkg_nsect; } - ASSERT(phys_spc != 0); + if (phys_spc == 0) + return; cl->cl_g.dkg_pcyl = cl->cl_solaris_size / phys_spc; if (cl->cl_alter_behavior & CMLB_FAKE_LABEL_ONE_PARTITION) { /* disable devid */