Commit fa9a17be authored by Federico Vaga's avatar Federico Vaga

sw:drv: can't allocate the maximum, make it smaller

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent fd2d09bc
......@@ -263,7 +263,7 @@ static ssize_t spec_fpga_dbg_dma_read(struct file *file, char __user *buf,
if (count == 0)
return 0;
count = min(KMALLOC_MAX_SIZE, count);
count = min(KMALLOC_MAX_SIZE / 2, count);
data = kmalloc(count, GFP_KERNEL);
if (!data)
return -ENOMEM;
......@@ -296,7 +296,7 @@ static ssize_t spec_fpga_dbg_dma_write(struct file *file,
if (count == 0)
return 0;
count = max(KMALLOC_MAX_SIZE, count);
count = max(KMALLOC_MAX_SIZE / 2, count);
data = kmalloc(count, GFP_KERNEL);
if (!data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment