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
ef525199
Commit
ef525199
authored
Dec 02, 2011
by
Jeremy Fitzhardinge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hid-input/battery: remove apparently redundant kmalloc
Signed-off-by:
Jeremy Fitzhardinge
<
jeremy@goop.org
>
parent
c5a92aa3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
12 deletions
+3
-12
drivers/hid/hid-input.c
drivers/hid/hid-input.c
+3
-12
No files found.
drivers/hid/hid-input.c
View file @
ef525199
...
...
@@ -287,7 +287,7 @@ static int hidinput_get_battery_property(struct power_supply *psy,
struct
hid_device
*
dev
=
container_of
(
psy
,
struct
hid_device
,
battery
);
int
ret
=
0
;
int
ret_rep
;
__u8
*
buf
=
NULL
;
__u8
buf
[
2
]
=
{}
;
unsigned
char
report_number
=
dev
->
battery_report_id
;
switch
(
prop
)
{
...
...
@@ -297,14 +297,8 @@ static int hidinput_get_battery_property(struct power_supply *psy,
break
;
case
POWER_SUPPLY_PROP_CAPACITY
:
buf
=
kmalloc
(
2
*
sizeof
(
__u8
),
GFP_KERNEL
);
if
(
!
buf
)
{
ret
=
-
ENOMEM
;
break
;
}
memset
(
buf
,
0
,
sizeof
(
buf
));
ret_rep
=
dev
->
hid_get_raw_report
(
dev
,
report_number
,
buf
,
sizeof
(
buf
),
HID_FEATURE_REPORT
);
ret_rep
=
dev
->
hid_get_raw_report
(
dev
,
report_number
,
buf
,
sizeof
(
buf
),
HID_FEATURE_REPORT
);
if
(
ret_rep
!=
2
)
{
ret
=
-
EINVAL
;
break
;
...
...
@@ -329,9 +323,6 @@ static int hidinput_get_battery_property(struct power_supply *psy,
break
;
}
if
(
buf
)
{
kfree
(
buf
);
}
return
ret
;
}
...
...
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