hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/security/integrity/digsig.c
....@@ -120,6 +120,7 @@
120120 {
121121 struct key_restriction *restriction;
122122 key_perm_t perm;
123
+ int ret;
123124
124125 perm = (KEY_POS_ALL & ~KEY_POS_SETATTR) | KEY_USR_VIEW
125126 | KEY_USR_READ | KEY_USR_SEARCH;
....@@ -140,7 +141,10 @@
140141 perm |= KEY_USR_WRITE;
141142
142143 out:
143
- return __integrity_init_keyring(id, perm, restriction);
144
+ ret = __integrity_init_keyring(id, perm, restriction);
145
+ if (ret)
146
+ kfree(restriction);
147
+ return ret;
144148 }
145149
146150 int __init integrity_add_key(const unsigned int id, const void *data,