mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-15 05:55:11 +08:00
dcb: Fix compilation warning about reallocarray
In older distros we need bsd/stdlib.h but newer distro doesn't
need it. Also old distro will need libbsd-devel installed and newer
doesn't. To remove a possible dependency on libbsd-devel replace usage
of reallocarray to realloc.
dcb_app.c: In function ‘dcb_app_table_push’:
dcb_app.c:68:25: warning: implicit declaration of function ‘reallocarray’; did you mean ‘realloc’?
Fixes: 8e9bed1493
("dcb: Add a subtool for the DCB APP object")
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
6739068fb0
commit
9f366536ed
@ -65,8 +65,7 @@ static void dcb_app_table_fini(struct dcb_app_table *tab)
|
||||
|
||||
static int dcb_app_table_push(struct dcb_app_table *tab, struct dcb_app *app)
|
||||
{
|
||||
struct dcb_app *apps = reallocarray(tab->apps, tab->n_apps + 1,
|
||||
sizeof(*tab->apps));
|
||||
struct dcb_app *apps = realloc(tab->apps, (tab->n_apps + 1) * sizeof(*tab->apps));
|
||||
|
||||
if (apps == NULL) {
|
||||
perror("Cannot allocate APP table");
|
||||
|
Loading…
Reference in New Issue
Block a user