diff options
author | Alan Cox <alan@linux.intel.com> | 2012-09-28 12:20:02 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-04-10 03:20:08 +0100 |
commit | fe2e7c989d397460ce1df3ee7ba3aa8730d760b7 (patch) | |
tree | c3999773188416afd69ee4c52925087c5c951655 | |
parent | 6a2c19ca2210f3f3eef99eeca550acd06e54c0c0 (diff) | |
download | kernel_samsung_smdk4412-fe2e7c989d397460ce1df3ee7ba3aa8730d760b7.zip kernel_samsung_smdk4412-fe2e7c989d397460ce1df3ee7ba3aa8730d760b7.tar.gz kernel_samsung_smdk4412-fe2e7c989d397460ce1df3ee7ba3aa8730d760b7.tar.bz2 |
key: Fix resource leak
commit a84a921978b7d56e0e4b87ffaca6367429b4d8ff upstream.
On an error iov may still have been reallocated and need freeing
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | security/keys/keyctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index 0b3f5d7..b70eaa2 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c @@ -1067,12 +1067,12 @@ long keyctl_instantiate_key_iov(key_serial_t id, ret = rw_copy_check_uvector(WRITE, _payload_iov, ioc, ARRAY_SIZE(iovstack), iovstack, &iov, 1); if (ret < 0) - return ret; + goto err; if (ret == 0) goto no_payload_free; ret = keyctl_instantiate_key_common(id, iov, ioc, ret, ringid); - +err: if (iov != iovstack) kfree(iov); return ret; |