Skip to content

Commit d54a197

Browse files
Himanshu Shuklacschaufler
authored andcommitted
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>
1 parent 2e962e2 commit d54a197

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

‎security/smack/smack_lsm.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,6 @@ static int smk_copy_rules(struct list_head *nhead, struct list_head *ohead,
348348
struct smack_rule *orp;
349349
int rc = 0;
350350

351-
INIT_LIST_HEAD(nhead);
352-
353351
list_for_each_entry_rcu(orp, ohead, list) {
354352
nrp = kzalloc(sizeof(struct smack_rule), gfp);
355353
if (nrp == NULL) {
@@ -376,8 +374,6 @@ static int smk_copy_relabel(struct list_head *nhead, struct list_head *ohead,
376374
struct smack_known_list_elem *nklep;
377375
struct smack_known_list_elem *oklep;
378376

379-
INIT_LIST_HEAD(nhead);
380-
381377
list_for_each_entry(oklep, ohead, list) {
382378
nklep = kzalloc(sizeof(struct smack_known_list_elem), gfp);
383379
if (nklep == NULL) {

0 commit comments

Comments
 (0)