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
a6f14e3e
Commit
a6f14e3e
authored
Feb 12, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:drv: bugfix missing copy_from_user
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
945e9c60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
spec-core.c
software/kernel/spec-core.c
+11
-2
No files found.
software/kernel/spec-core.c
View file @
a6f14e3e
...
...
@@ -64,17 +64,26 @@ static const struct file_operations spec_irq_dbg_info_ops = {
.
release
=
single_release
,
};
#define SPEC_DBG_FW_BUF_LEN 128
static
ssize_t
spec_dbg_fw_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
{
struct
spec_gn412x
*
spec_gn412x
=
file
->
private_data
;
char
buf_l
[
SPEC_DBG_FW_BUF_LEN
];
int
err
;
if
(
!
buf
||
!
count
)
{
dev_err
(
&
spec_gn412x
->
pdev
->
dev
,
"Invalid input
\n
"
);
if
(
SPEC_DBG_FW_BUF_LEN
<
count
)
{
dev_err
(
&
spec_gn412x
->
pdev
->
dev
,
"Firmware name too long max %u
\n
"
,
SPEC_DBG_FW_BUF_LEN
);
return
-
EINVAL
;
}
memset
(
buf_l
,
0
,
SPEC_DBG_FW_BUF_LEN
);
err
=
copy_from_user
(
buf_l
,
buf
,
count
);
if
(
err
)
return
-
EFAULT
;
err
=
spec_fw_load
(
spec_gn412x
,
buf
);
if
(
err
)
...
...
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