aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/crypto.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-08-02 10:57:31 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-02 10:57:31 -0700
commitc8924234bd9c06fe86bae648c472d56cb10640a5 (patch)
treeb7ecba9e5fd1f7c451f00fc52a98c321153cc522 /net/ceph/crypto.h
parentMerge tag 'ecryptfs-3.6-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs (diff)
parentlibceph: fix crypto key null deref, memory leak (diff)
downloadlinux-dev-c8924234bd9c06fe86bae648c472d56cb10640a5.tar.xz
linux-dev-c8924234bd9c06fe86bae648c472d56cb10640a5.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull two ceph fixes from Sage Weil: "The first patch fixes up the old crufty open intent code to use the atomic_open stuff properly, and the second fixes a possible null deref and memory leak with the crypto keys." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: libceph: fix crypto key null deref, memory leak ceph: simplify+fix atomic_open
Diffstat (limited to 'net/ceph/crypto.h')
-rw-r--r--net/ceph/crypto.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ceph/crypto.h b/net/ceph/crypto.h
index 1919d1550d75..3572dc518bc9 100644
--- a/net/ceph/crypto.h
+++ b/net/ceph/crypto.h
@@ -16,7 +16,8 @@ struct ceph_crypto_key {
static inline void ceph_crypto_key_destroy(struct ceph_crypto_key *key)
{
- kfree(key->key);
+ if (key)
+ kfree(key->key);
}
extern int ceph_crypto_key_clone(struct ceph_crypto_key *dst,