Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple PCIe FMC carrier SPEC
Commits
4f2c8eaf
Commit
4f2c8eaf
authored
Aug 12, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv:dma: validate dma_slave_config
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
dd33c15e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
spec-gn412x-dma.c
software/kernel/spec-gn412x-dma.c
+7
-0
No files found.
software/kernel/spec-gn412x-dma.c
View file @
4f2c8eaf
...
...
@@ -352,6 +352,7 @@ static int gn412x_dma_alloc_chan_resources(struct dma_chan *dchan)
struct
gn412x_dma_chan
*
chan
=
to_gn412x_dma_chan
(
dchan
);
memset
(
&
chan
->
sconfig
,
0
,
sizeof
(
struct
dma_slave_config
));
chan
->
sconfig
.
direction
=
DMA_DEV_TO_MEM
;
return
0
;
}
...
...
@@ -427,6 +428,12 @@ static struct dma_async_tx_descriptor *gn412x_dma_prep_slave_sg(
goto
err
;
}
if
(
unlikely
(
sconfig
->
direction
!=
direction
))
{
dev_err
(
&
chan
->
dev
->
device
,
"Transfer and slave configuration disagree on DMA direction
\n
"
);
goto
err
;
}
if
(
unlikely
(
!
sgl
||
!
sg_len
))
{
dev_err
(
&
chan
->
dev
->
device
,
"You must provide a DMA scatterlist
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment