git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
fs
/
partitions
/
ibm.c
diff --git
a/fs/partitions/ibm.c
b/fs/partitions/ibm.c
index
d352a73
..
9f7ad42
100644
(file)
--- a/
fs/partitions/ibm.c
+++ b/
fs/partitions/ibm.c
@@
-43,7
+43,7
@@
cchhb2blk (struct vtoc_cchhb *ptr, struct hd_geometry *geo) {
int
ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
{
int
ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
{
- int blocksize, offset, size;
+ int blocksize, offset, size
,res
;
loff_t i_size;
dasd_information_t *info;
struct hd_geometry *geo;
loff_t i_size;
dasd_information_t *info;
struct hd_geometry *geo;
@@
-56,15
+56,16
@@
ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
unsigned char *data;
Sector sect;
unsigned char *data;
Sector sect;
+ res = 0;
blocksize = bdev_hardsect_size(bdev);
if (blocksize <= 0)
blocksize = bdev_hardsect_size(bdev);
if (blocksize <= 0)
-
return 0
;
+
goto out_exit
;
i_size = i_size_read(bdev->bd_inode);
if (i_size == 0)
i_size = i_size_read(bdev->bd_inode);
if (i_size == 0)
-
return 0
;
+
goto out_exit
;
if ((info = kmalloc(sizeof(dasd_information_t), GFP_KERNEL)) == NULL)
if ((info = kmalloc(sizeof(dasd_information_t), GFP_KERNEL)) == NULL)
- goto out_
noinfo
;
+ goto out_
exit
;
if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL)
goto out_nogeo;
if ((label = kmalloc(sizeof(union label_t), GFP_KERNEL)) == NULL)
if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL)
goto out_nogeo;
if ((label = kmalloc(sizeof(union label_t), GFP_KERNEL)) == NULL)
@@
-72,7
+73,7
@@
ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 ||
ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0)
if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 ||
ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0)
- goto out_
noioct
l;
+ goto out_
freeal
l;
/*
* Get volume label, extract name and type.
/*
* Get volume label, extract name and type.
@@
-92,6
+93,8
@@
ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
EBCASC(type, 4);
EBCASC(name, 6);
EBCASC(type, 4);
EBCASC(name, 6);
+ res = 1;
+
/*
* Three different types: CMS1, VOL1 and LNX1/unlabeled
*/
/*
* Three different types: CMS1, VOL1 and LNX1/unlabeled
*/
@@
-156,6
+159,9
@@
ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
counter++;
blk++;
}
counter++;
blk++;
}
+ if (!data)
+ /* Are we not supposed to report this ? */
+ goto out_readerr;
} else {
/*
* Old style LNX1 or unlabeled disk
} else {
/*
* Old style LNX1 or unlabeled disk
@@
-171,18
+177,17
@@
ibm_partition(struct parsed_partitions *state, struct block_device *bdev)
}
printk("\n");
}
printk("\n");
- kfree(label);
- kfree(geo);
- kfree(info);
- return 1;
+ goto out_freeall;
+
out_readerr:
out_readerr:
-out_noioctl:
+ res = -1;
+out_freeall:
kfree(label);
out_nolab:
kfree(geo);
out_nogeo:
kfree(info);
kfree(label);
out_nolab:
kfree(geo);
out_nogeo:
kfree(info);
-out_
noinfo
:
- return
0
;
+out_
exit
:
+ return
res
;
}
}