Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
54d2f649
Commit
54d2f649
authored
Dec 29, 2008
by
James Morris
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'next' into for-linus
parents
541ef5cb
81ea714b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
security/smack/smackfs.c
security/smack/smackfs.c
+16
-4
No files found.
security/smack/smackfs.c
View file @
54d2f649
...
...
@@ -185,11 +185,15 @@ static int smk_open_load(struct inode *inode, struct file *file)
* the subject/object pair and replaces the access that was
* there. If the pair isn't found add it with the specified
* access.
*
* Returns 0 if nothing goes wrong or -ENOMEM if it fails
* during the allocation of the new pair to add.
*/
static
void
smk_set_access
(
struct
smack_rule
*
srp
)
static
int
smk_set_access
(
struct
smack_rule
*
srp
)
{
struct
smk_list_entry
*
sp
;
struct
smk_list_entry
*
newp
;
int
ret
=
0
;
mutex_lock
(
&
smack_list_lock
);
...
...
@@ -202,14 +206,20 @@ static void smk_set_access(struct smack_rule *srp)
if
(
sp
==
NULL
)
{
newp
=
kzalloc
(
sizeof
(
struct
smk_list_entry
),
GFP_KERNEL
);
if
(
newp
==
NULL
)
{
ret
=
-
ENOMEM
;
goto
out
;
}
newp
->
smk_rule
=
*
srp
;
newp
->
smk_next
=
smack_list
;
smack_list
=
newp
;
}
out:
mutex_unlock
(
&
smack_list_lock
);
return
;
return
ret
;
}
/**
...
...
@@ -309,7 +319,9 @@ static ssize_t smk_write_load(struct file *file, const char __user *buf,
goto
out
;
}
smk_set_access
(
&
rule
);
rc
=
smk_set_access
(
&
rule
);
if
(
!
rc
)
rc
=
count
;
out:
...
...
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