mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix major number filter structure boundary test.
This commit is contained in:
parent
a3390bb507
commit
64f1fd749f
@ -319,7 +319,7 @@ static int _scan_proc_dev(const char *proc, const struct dm_config_node *cn)
|
||||
|
||||
int max_partitions(int major)
|
||||
{
|
||||
if (major > NUMBER_OF_MAJORS)
|
||||
if (major >= NUMBER_OF_MAJORS)
|
||||
return 0;
|
||||
|
||||
return _partitions[major].max_partitions;
|
||||
@ -327,7 +327,7 @@ int max_partitions(int major)
|
||||
|
||||
int major_is_scsi_device(int major)
|
||||
{
|
||||
if (major > NUMBER_OF_MAJORS)
|
||||
if (major >= NUMBER_OF_MAJORS)
|
||||
return 0;
|
||||
|
||||
return (_partitions[major].flags & PARTITION_SCSI_DEVICE) ? 1 : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user