Skip to content

Commit

Permalink
apparmor: Replace two seq_printf() calls by seq_puts() in aa_label_se…
Browse files Browse the repository at this point in the history
…q_xprint()

Two strings which did not contain a data format specification should be put
into a sequence. Thus use the corresponding function “seq_puts”.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Signed-off-by: John Johansen <[email protected]>
  • Loading branch information
elfring authored and John Johansen committed Jan 18, 2020
1 parent c79f46a commit 278de07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/apparmor/label.c
Original file line number Diff line number Diff line change
Expand Up @@ -1749,13 +1749,13 @@ void aa_label_seq_xprint(struct seq_file *f, struct aa_ns *ns,
AA_DEBUG("label print error");
return;
}
seq_printf(f, "%s", str);
seq_puts(f, str);
kfree(str);
} else if (display_mode(ns, label, flags))
seq_printf(f, "%s (%s)", label->hname,
label_modename(ns, label, flags));
else
seq_printf(f, "%s", label->hname);
seq_puts(f, label->hname);
}

void aa_label_xprintk(struct aa_ns *ns, struct aa_label *label, int flags,
Expand Down

0 comments on commit 278de07

Please sign in to comment.