Skip to content

Commit 3749bda

Browse files
committed
Merge tag 'audit-pr-20240312' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit
Pull audit updates from Paul Moore: "Two small audit patches: - Use the KMEM_CACHE() macro instead of kmem_cache_create() The guidance appears to be to use the KMEM_CACHE() macro when possible and there is no reason why we can't use the macro, so let's use it. - Remove an unnecessary assignment in audit_dupe_lsm_field() A return value variable was assigned a value in its declaration, but the declaration value is overwritten before the return value variable is ever referenced; drop the assignment at declaration time" * tag 'audit-pr-20240312' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: use KMEM_CACHE() instead of kmem_cache_create() audit: remove unnecessary assignment in audit_dupe_lsm_field()
2 parents 681ba31 + aa13b70 commit 3749bda

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

kernel/audit.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,9 +1693,7 @@ static int __init audit_init(void)
16931693
if (audit_initialized == AUDIT_DISABLED)
16941694
return 0;
16951695

1696-
audit_buffer_cache = kmem_cache_create("audit_buffer",
1697-
sizeof(struct audit_buffer),
1698-
0, SLAB_PANIC, NULL);
1696+
audit_buffer_cache = KMEM_CACHE(audit_buffer, SLAB_PANIC);
16991697

17001698
skb_queue_head_init(&audit_queue);
17011699
skb_queue_head_init(&audit_retry_queue);

kernel/auditfilter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ static int audit_compare_rule(struct audit_krule *a, struct audit_krule *b)
788788
static inline int audit_dupe_lsm_field(struct audit_field *df,
789789
struct audit_field *sf)
790790
{
791-
int ret = 0;
791+
int ret;
792792
char *lsm_str;
793793

794794
/* our own copy of lsm_str */

0 commit comments

Comments
 (0)