Using vmalloc() for FoE memory allocation.

This commit is contained in:
Florian Pose 2020-01-24 11:09:48 +01:00
parent d8a487fc8c
commit 0a14b16aef
1 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,7 @@
/******************************************************************************
*
* $Id$
*
* Copyright (C) 2008 Olav Zarges, imc Messsysteme GmbH
* Copyright (C) 2020 Florian Pose, IgH
*
* This file is part of the IgH EtherCAT Master.
*
@ -36,6 +35,7 @@
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include "foe_request.h"
#include "foe.h"
@ -91,7 +91,7 @@ void ec_foe_request_clear_data(
)
{
if (req->buffer) {
kfree(req->buffer);
vfree(req->buffer);
req->buffer = NULL;
}
@ -119,7 +119,7 @@ int ec_foe_request_alloc(
ec_foe_request_clear_data(req);
if (!(req->buffer = (uint8_t *) kmalloc(size, GFP_KERNEL))) {
if (!(req->buffer = (uint8_t *) vmalloc(size))) {
EC_ERR("Failed to allocate %zu bytes of FoE memory.\n", size);
return -ENOMEM;
}