mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
* grub-core/fs/zfs.c: Remove variable length arrays.
Reduces zfs.mod by 160 bytes (208 compressed).
This commit is contained in:
1 parent
7152393503
commit
f3e393411b
2 files changed
+13
-4
No files matched your search
@@ -1,3 +1,8 @@
|
|||||||
|
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/fs/zfs.c: Remove variable length arrays.
|
||||||
|
Reduces zfs.mod by 160 bytes (208 compressed).
|
||||||
|
|
||||||
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/zfs/zfs.c (check_pool_label): Fix memory leak.
|
* grub-core/fs/zfs/zfs.c (check_pool_label): Fix memory leak.
|
||||||
|
|||||||
@@ -1302,7 +1302,9 @@ gf_mul (grub_uint8_t a, grub_uint8_t b)
|
|||||||
return powx[powx_inv[a] + powx_inv[b]];
|
return powx[powx_inv[a] + powx_inv[b]];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline grub_err_t
|
#define MAX_NBUFS 4
|
||||||
|
|
||||||
|
static grub_err_t
|
||||||
recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs,
|
recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs,
|
||||||
const unsigned *powers,
|
const unsigned *powers,
|
||||||
const int *idx)
|
const int *idx)
|
||||||
@@ -1356,9 +1358,9 @@ recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs,
|
|||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
}
|
}
|
||||||
/* Otherwise use Gauss. */
|
/* Otherwise use Gauss. */
|
||||||
default:
|
case 3:
|
||||||
{
|
{
|
||||||
grub_uint8_t matrix1[nbufs][nbufs], matrix2[nbufs][nbufs];
|
grub_uint8_t matrix1[MAX_NBUFS][MAX_NBUFS], matrix2[MAX_NBUFS][MAX_NBUFS];
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
|
|
||||||
for (i = 0; i < nbufs; i++)
|
for (i = 0; i < nbufs; i++)
|
||||||
@@ -1426,7 +1428,7 @@ recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs,
|
|||||||
|
|
||||||
for (i = 0; i < (int) s; i++)
|
for (i = 0; i < (int) s; i++)
|
||||||
{
|
{
|
||||||
grub_uint8_t b[nbufs];
|
grub_uint8_t b[MAX_NBUFS];
|
||||||
for (j = 0; j < nbufs; j++)
|
for (j = 0; j < nbufs; j++)
|
||||||
b[j] = bufs[j][i];
|
b[j] = bufs[j][i];
|
||||||
for (j = 0; j < nbufs; j++)
|
for (j = 0; j < nbufs; j++)
|
||||||
@@ -1438,6 +1440,8 @@ recovery (grub_uint8_t *bufs[4], grub_size_t s, const int nbufs,
|
|||||||
}
|
}
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
return grub_error (GRUB_ERR_BUG, "too big matrix");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user