| .. | .. |
|---|
| 120 | 120 | { |
|---|
| 121 | 121 | struct key_restriction *restriction; |
|---|
| 122 | 122 | key_perm_t perm; |
|---|
| 123 | + int ret; |
|---|
| 123 | 124 | |
|---|
| 124 | 125 | perm = (KEY_POS_ALL & ~KEY_POS_SETATTR) | KEY_USR_VIEW |
|---|
| 125 | 126 | | KEY_USR_READ | KEY_USR_SEARCH; |
|---|
| .. | .. |
|---|
| 140 | 141 | perm |= KEY_USR_WRITE; |
|---|
| 141 | 142 | |
|---|
| 142 | 143 | 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; |
|---|
| 144 | 148 | } |
|---|
| 145 | 149 | |
|---|
| 146 | 150 | int __init integrity_add_key(const unsigned int id, const void *data, |
|---|