Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christian Löpke
bs
Commits
f463479b
There was a problem fetching the pipeline summary.
Commit
f463479b
authored
9 years ago
by
Christian Löpke
Browse files
Options
Downloads
Patches
Plain Diff
Fixed broken indention whitespace -> tab
parent
f15221c9
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
20160425/chardev-1write.c
+9
-9
9 additions, 9 deletions
20160425/chardev-1write.c
with
9 additions
and
9 deletions
20160425/chardev-1write.c
+
9
−
9
View file @
f463479b
...
...
@@ -189,16 +189,16 @@ device_write(struct file *filp, const char *buff, size_t len, loff_t * off)
DEVICE_NAME
,
USERBUF_LEN
);
return
-
ENOMEM
;
//Return not enaugh memory
}
else
{
}
else
{
int
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
//Save the given string
if
(
get_user
(
msg_username
[
i
],
buff
+
i
)
<
0
)
{
//If returning error code
printk
(
KERN_WARNING
"%s: You want to play a trick on me! This memory does not belong to you!
\n
"
,
DEVICE_NAME
);
return
-
EFAULT
;
//Stop reading from userspace.
}
for
(
i
=
0
;
i
<
len
;
i
++
)
{
//Save the given string
if
(
get_user
(
msg_username
[
i
],
buff
+
i
)
<
0
)
{
//If returning error code
printk
(
KERN_WARNING
"%s: This memory does not belong to you!
\n
"
,
DEVICE_NAME
);
return
-
EFAULT
;
//Stop reading from userspace.
}
//msg_username[i] = buff[i]; //Heres was the CRASH
//printk(KERN_INFO "Got %c at %d from %d bytes.\n", buff[i], i, len);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment