Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion drivers/misc/icvs/intel_cvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/sysfs.h>
#include <linux/fs.h>
#include <linux/file.h>
#include <linux/vmalloc.h>

#include "cvs_gpio.h"
#include "intel_cvs_update.h"
Expand Down Expand Up @@ -210,6 +211,9 @@ static void cvs_i2c_remove(struct i2c_client *i2c)
}
cvs_exit(icvs);
}
if (cvs->fw_buffer)
vfree(cvs->fw_buffer);

devm_kfree(&i2c->dev, icvs);
}
}
Expand Down Expand Up @@ -525,7 +529,7 @@ static ssize_t cvs_ctrl_data_pre_store(struct device *dev,
cvs->fw_buffer_size = fw_bin_size;
cvs->max_flashtime_ms = cvs->plugin_to_cvs.max_flash_time;
cvs->fw_update_retries = cvs->plugin_to_cvs.max_fwupd_retry_count;
cvs->fw_buffer = devm_kzalloc(cvs->dev, cvs->fw_buffer_size, GFP_KERNEL);
cvs->fw_buffer = vmalloc(cvs->fw_buffer_size);

if (IS_ERR_OR_NULL(cvs->fw_buffer)) {
dev_err(cvs->dev, "%s:No memory for fw_buffer", __func__);
Expand Down