forked from len0rd/rockbox
disk.c ensure a valid volume is returned from get_free_volume()
volume is used for element math and indexing into buffers -1 volume is bad Change-Id: I1ec75ef3a848c154ea80905224ea9a3a14bf8151
This commit is contained in:
parent
d57900ae12
commit
cb6b0d2c0e
1 changed files with 7 additions and 0 deletions
|
@ -174,6 +174,13 @@ int disk_mount(int drive)
|
||||||
|
|
||||||
int volume = get_free_volume();
|
int volume = get_free_volume();
|
||||||
|
|
||||||
|
if (volume < 0)
|
||||||
|
{
|
||||||
|
DEBUGF("No Free Volumes\n");
|
||||||
|
disk_writer_unlock();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!disk_init(IF_MD(drive)))
|
if (!disk_init(IF_MD(drive)))
|
||||||
{
|
{
|
||||||
disk_writer_unlock();
|
disk_writer_unlock();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue