Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
5bbc0a0d
Commit
5bbc0a0d
authored
10 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
maXTouch: Check for successful memory allocation was backward
parent
95bbdb67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/input/mxt.c
+3
-3
3 additions, 3 deletions
drivers/input/mxt.c
include/nuttx/i2c.h
+5
-4
5 additions, 4 deletions
include/nuttx/i2c.h
with
8 additions
and
7 deletions
drivers/input/mxt.c
+
3
−
3
View file @
5bbc0a0d
...
...
@@ -1498,7 +1498,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv)
/* Allocate memory for the object table */
priv
->
objtab
=
kzalloc
(
info
->
nobjects
*
sizeof
(
struct
mxt_object_s
));
if
(
priv
->
objtab
!
=
NULL
)
if
(
priv
->
objtab
=
=
NULL
)
{
idbg
(
"ERROR: Failed to allocate object table
\n
"
);
return
-
ENOMEM
;
...
...
@@ -1568,7 +1568,7 @@ static int mxt_hwinitialize(FAR struct mxt_dev_s *priv)
priv
->
sample
=
(
FAR
struct
mxt_sample_s
*
)
kzalloc
(
nslots
*
sizeof
(
struct
mxt_sample_s
));
if
(
!
priv
->
sample
)
if
(
priv
->
sample
==
NULL
)
{
idbg
(
"ERROR: Failed to allocate object table
\n
"
);
goto
errout_with_objtab
;
...
...
@@ -1632,7 +1632,7 @@ int mxt_register(FAR struct i2c_dev_s *i2c,
/* Create and initialize a maXTouch device driver instance */
priv
=
(
FAR
struct
mxt_dev_s
*
)
kzalloc
(
sizeof
(
struct
mxt_dev_s
));
if
(
!
priv
)
if
(
priv
==
NULL
)
{
idbg
(
"ERROR: Failed allocate device structure
\n
"
);
return
-
ENOMEM
;
...
...
This diff is collapsed.
Click to expand it.
include/nuttx/i2c.h
+
5
−
4
View file @
5bbc0a0d
...
...
@@ -83,11 +83,12 @@
/* Bit definitions for the flags field in struct i2c_msg_s */
#define I2C_M_READ 0x0001
/* read data, from slave to master */
#define I2C_M_TEN 0x0002
/* ten bit address */
#define I2C_M_NORESTART 0x0080
/* message should not begin with (re-)start of transfer */
#define I2C_M_READ 0x0001
/* Read data, from slave to master */
#define I2C_M_TEN 0x0002
/* Ten bit address */
#define I2C_M_NORESTART 0x0080
/* Message should not begin with
* (re-)start of transfer */
/* Access macros */
/* Access macros
***********************************************************
*/
/****************************************************************************
* Name: I2C_SETFREQUENCY
...
...
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