Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0d8bc4d7
Commit
0d8bc4d7
authored
Nov 25, 2002
by
Dave Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Overflow checks in i2c
parent
b362ea98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
drivers/i2c/i2c-dev.c
drivers/i2c/i2c-dev.c
+6
-0
No files found.
drivers/i2c/i2c-dev.c
View file @
0d8bc4d7
...
...
@@ -115,6 +115,9 @@ static ssize_t i2cdev_read (struct file *file, char *buf, size_t count,
struct
i2c_client
*
client
=
(
struct
i2c_client
*
)
file
->
private_data
;
if
(
count
>
8192
)
count
=
8192
;
/* copy user space data to kernel space. */
tmp
=
kmalloc
(
count
,
GFP_KERNEL
);
if
(
tmp
==
NULL
)
...
...
@@ -143,6 +146,9 @@ static ssize_t i2cdev_write (struct file *file, const char *buf, size_t count,
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
#endif
/* DEBUG */
if
(
count
>
8192
)
count
=
8192
;
/* copy user space data to kernel space. */
tmp
=
kmalloc
(
count
,
GFP_KERNEL
);
if
(
tmp
==
NULL
)
...
...
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