Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
linux-guf
Manage
Activity
Members
Labels
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
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
SECO Northern Europe
Kernel
linux-guf
Commits
629b77a4
Commit
629b77a4
authored
19 years ago
by
Greg Kroah-Hartman
Browse files
Options
Downloads
Patches
Plain Diff
[PATCH] INPUT: Fix oops when accessing sysfs files of nested input devices
Signed-off-by:
Greg Kroah-Hartman
<
gregkh@suse.de
>
parent
967ca692
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/input/input.c
+12
-7
12 additions, 7 deletions
drivers/input/input.c
with
12 additions
and
7 deletions
drivers/input/input.c
+
12
−
7
View file @
629b77a4
...
@@ -642,17 +642,22 @@ static ssize_t input_dev_show_##name(struct class_device *dev, char *buf) \
...
@@ -642,17 +642,22 @@ static ssize_t input_dev_show_##name(struct class_device *dev, char *buf) \
up(&input_dev->sem); \
up(&input_dev->sem); \
\
\
return retval; \
return retval; \
}
} \
static CLASS_DEVICE_ATTR(name, S_IRUGO, input_dev_show_##name, NULL);
INPUT_DEV_STRING_ATTR_SHOW
(
name
);
INPUT_DEV_STRING_ATTR_SHOW
(
name
);
INPUT_DEV_STRING_ATTR_SHOW
(
phys
);
INPUT_DEV_STRING_ATTR_SHOW
(
phys
);
INPUT_DEV_STRING_ATTR_SHOW
(
uniq
);
INPUT_DEV_STRING_ATTR_SHOW
(
uniq
);
static
struct
class_device_attribute
input_dev_attrs
[]
=
{
static
struct
attribute
*
input_dev_attrs
[]
=
{
__ATTR
(
name
,
S_IRUGO
,
input_dev_show_name
,
NULL
),
&
class_device_attr_name
.
attr
,
__ATTR
(
phys
,
S_IRUGO
,
input_dev_show_phys
,
NULL
),
&
class_device_attr_phys
.
attr
,
__ATTR
(
uniq
,
S_IRUGO
,
input_dev_show_uniq
,
NULL
),
&
class_device_attr_uniq
.
attr
,
__ATTR_NULL
NULL
};
static
struct
attribute_group
input_dev_group
=
{
.
attrs
=
input_dev_attrs
,
};
};
#define INPUT_DEV_ID_ATTR(name) \
#define INPUT_DEV_ID_ATTR(name) \
...
@@ -728,7 +733,6 @@ static void input_dev_release(struct class_device *class_dev)
...
@@ -728,7 +733,6 @@ static void input_dev_release(struct class_device *class_dev)
struct
class
input_dev_class
=
{
struct
class
input_dev_class
=
{
.
name
=
"input_dev"
,
.
name
=
"input_dev"
,
.
release
=
input_dev_release
,
.
release
=
input_dev_release
,
.
class_dev_attrs
=
input_dev_attrs
,
};
};
struct
input_dev
*
input_allocate_device
(
void
)
struct
input_dev
*
input_allocate_device
(
void
)
...
@@ -766,6 +770,7 @@ static void input_register_classdevice(struct input_dev *dev)
...
@@ -766,6 +770,7 @@ static void input_register_classdevice(struct input_dev *dev)
kfree
(
path
);
kfree
(
path
);
class_device_add
(
&
dev
->
cdev
);
class_device_add
(
&
dev
->
cdev
);
sysfs_create_group
(
&
dev
->
cdev
.
kobj
,
&
input_dev_group
);
sysfs_create_group
(
&
dev
->
cdev
.
kobj
,
&
input_dev_id_attr_group
);
sysfs_create_group
(
&
dev
->
cdev
.
kobj
,
&
input_dev_id_attr_group
);
sysfs_create_group
(
&
dev
->
cdev
.
kobj
,
&
input_dev_caps_attr_group
);
sysfs_create_group
(
&
dev
->
cdev
.
kobj
,
&
input_dev_caps_attr_group
);
}
}
...
...
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