diff options
| author | Himanshu Shukla <himanshu.sh@samsung.com> | 2016-11-23 01:28:48 -0500 |
|---|---|---|
| committer | Casey Schaufler <casey@schaufler-ca.com> | 2017-01-10 12:47:20 -0500 |
| commit | d54a197964e7eb636a0c64fb0dbdd67759eb71f2 (patch) | |
| tree | 3d81c63d469b9e83d7ee9dad9528f786fd74aaaf /security | |
| parent | 2e962e2fec5c35b91e3b541e2b8373504bf91e27 (diff) | |
SMACK: Delete list_head repeated initialization
smk_copy_rules() and smk_copy_relabel() are initializing list_head though
they have been initialized already in new_task_smack() function. Delete
repeated initialization.
Signed-off-by: Himanshu Shukla <himanshu.sh@samsung.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security')
| -rw-r--r-- | security/smack/smack_lsm.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index ed6885bccec4..1368f8925343 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
| @@ -348,8 +348,6 @@ static int smk_copy_rules(struct list_head *nhead, struct list_head *ohead, | |||
| 348 | struct smack_rule *orp; | 348 | struct smack_rule *orp; |
| 349 | int rc = 0; | 349 | int rc = 0; |
| 350 | 350 | ||
| 351 | INIT_LIST_HEAD(nhead); | ||
| 352 | |||
| 353 | list_for_each_entry_rcu(orp, ohead, list) { | 351 | list_for_each_entry_rcu(orp, ohead, list) { |
| 354 | nrp = kzalloc(sizeof(struct smack_rule), gfp); | 352 | nrp = kzalloc(sizeof(struct smack_rule), gfp); |
| 355 | if (nrp == NULL) { | 353 | if (nrp == NULL) { |
| @@ -376,8 +374,6 @@ static int smk_copy_relabel(struct list_head *nhead, struct list_head *ohead, | |||
| 376 | struct smack_known_list_elem *nklep; | 374 | struct smack_known_list_elem *nklep; |
| 377 | struct smack_known_list_elem *oklep; | 375 | struct smack_known_list_elem *oklep; |
| 378 | 376 | ||
| 379 | INIT_LIST_HEAD(nhead); | ||
| 380 | |||
| 381 | list_for_each_entry(oklep, ohead, list) { | 377 | list_for_each_entry(oklep, ohead, list) { |
| 382 | nklep = kzalloc(sizeof(struct smack_known_list_elem), gfp); | 378 | nklep = kzalloc(sizeof(struct smack_known_list_elem), gfp); |
| 383 | if (nklep == NULL) { | 379 | if (nklep == NULL) { |
