KEYS: potential uninitialized variable
Subsystems (3)
PATCH 1/1 KEYS: potential uninitialized variable
If __key_link_begin() failed then "edit" would be uninitialized. I've added a check to fix that.
Fixes f70e2e06196a ('KEYS: Do preallocation for __key_link()')
Signed-off-by Dan Carpenter <[email protected]>
security/keys/key.c +1 -1
@@ -597,7 +597,7 @@ int key_reject_and_link(struct key *key,mutex_unlock (&key_construction_mutex); -if (keyring) +if (keyring && link_ret =0 )__key_link_end (keyring, &key->index_key, edit);/* wake up anyone waiting for a key to be constructed */
Quoted 5 lines · Dan Carpenter
If
__key_link_begin()failed then "edit" would be uninitialized. I've added a check to fix that.Fixes f70e2e06196a ('KEYS: Do preallocation for __key_link()')Signed-off-by Dan Carpenter <[email protected]>
Applied.