View | Details | Raw Unified | Return to bug 83361
Collapse All | Expand All

(-)lib/libdisk/write_ia64_disk.c (-1 / +3 lines)
Lines 245-251 Link Here
245
	if (sav > 0) {
245
	if (sav > 0) {
246
		save = malloc(sav * sizeof(struct gpt_ent));
246
		save = malloc(sav * sizeof(struct gpt_ent));
247
		if (save == NULL)
247
		if (save == NULL)
248
			abort();
248
			return(ENOMEM);
249
		sav = 0;
249
		sav = 0;
250
		for (c = disk->chunks->part; c != NULL; c = c->next) {
250
		for (c = disk->chunks->part; c != NULL; c = c->next) {
251
			if ((c->flags & CHUNK_HAS_INDEX)) {
251
			if ((c->flags & CHUNK_HAS_INDEX)) {
Lines 332-337 Link Here
332
		bufsz += disk->sector_size;
332
		bufsz += disk->sector_size;
333
	bufsz = (bufsz / disk->sector_size) * disk->sector_size;
333
	bufsz = (bufsz / disk->sector_size) * disk->sector_size;
334
	buffer = calloc(1, bufsz);
334
	buffer = calloc(1, bufsz);
335
	if (buffer == NULL)
336
		return (ENOMEM);
335
337
336
	memcpy(buffer, &hdr[0], sizeof(struct gpt_hdr));
338
	memcpy(buffer, &hdr[0], sizeof(struct gpt_hdr));
337
	off = hdr[0].hdr_lba_self * disk->sector_size;
339
	off = hdr[0].hdr_lba_self * disk->sector_size;
(-)lib/libdisk/write_sparc64_disk.c (-2 / +5 lines)
Lines 44-53 Link Here
44
	fd = open(device, O_RDWR);
44
	fd = open(device, O_RDWR);
45
	if (fd < 0) {
45
	if (fd < 0) {
46
		warn("open(%s) failed", device);
46
		warn("open(%s) failed", device);
47
		return (1);
47
		return (errno);
48
	}
48
	}
49
49
50
	sl = calloc(sizeof *sl, 1);
50
	if ((sl = calloc(sizeof *sl, 1)) == NULL) {
51
		close(fd);
52
		return(ENOMEM);
53
	}
51
	c = d1->chunks;
54
	c = d1->chunks;
52
	c2 = c->part;
55
	c2 = c->part;
53
	secpercyl = d1->bios_sect * d1->bios_hd;
56
	secpercyl = d1->bios_sect * d1->bios_hd;

Return to bug 83361