Commit be50112e authored by Federico Vaga's avatar Federico Vaga

drv: bug fix when building scatterlist on 5.10

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 93a04fd1
......@@ -294,9 +294,8 @@ static int sg_alloc_table_from_block(struct device *dev,
size_t max_segment_size;
void *data;
int i;
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0)
int err;
#else
int err = 0;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
struct scatterlist *sg;
#endif
......@@ -338,10 +337,12 @@ static int sg_alloc_table_from_block(struct device *dev,
NULL,
0,
GFP_KERNEL);
if (IS_ERR(sg))
if (IS_ERR(sg)) {
err = PTR_ERR(sg);
sg_free_table(sgt);
}
kfree(pages);
return PTR_ERR(sg);
return err;
#endif
}
......
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