Skip to content
Permalink
Browse files

10311 addbadsec: NULL pointer errors

Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
tsoome authored and danmcd committed Jan 26, 2019
1 parent de4cec4 commit 8d44205c2de6047b3104694e998664b7a1c527ab
Showing with 3 additions and 3 deletions.
  1. +3 −3 usr/src/cmd/addbadsec/ix_altsctr.c
@@ -274,7 +274,7 @@ init_altsctr(void)
ap->ap_tblp->alts_map_base =
altsmap_alloc(ap->ap_tbl_secsiz / NBPSCTR,
ap->part.p_size, ap->ap_map_sectot, ALTS_MAP_UP);
if (ap->ap_tblp->alts_map_base == NULL) {
if (ap->ap_tblp->alts_map_base == 0) {
perror("Unable to allocate alternate map on disk: ");
exit(57);
}
@@ -482,7 +482,7 @@ gen_alts_ent(void)
altsmap_alloc(ap->ap_tblp->alts_map_base + ap->ap_map_sectot,
ap->part.p_size,
ap->ap_ent_secsiz / NBPSCTR, ALTS_MAP_UP);
if (ap->ap_tblp->alts_ent_base == NULL) {
if (ap->ap_tblp->alts_ent_base == 0) {
perror("Unable to allocate alternate entry table on disk: ");
exit(65);
}
@@ -512,7 +512,7 @@ assign_altsctr(void)
alts_ind =
altsmap_alloc(ap->part.p_size-1, ap->ap_tblp->alts_map_base +
ap->ap_map_sectot - 1, cluster, ALTS_MAP_DOWN);
if (alts_ind == NULL) {
if (alts_ind == 0) {
(void) fprintf(stderr,
"Unable to allocate alternates for bad starting"
" sector %u.\n", (ap->ap_entp)[i].bad_start);

0 comments on commit 8d44205

Please sign in to comment.
You can’t perform that action at this time.