--- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -1746,6 +1746,9 @@ struct ceph_cap_flush *ceph_alloc_cap_fl struct ceph_cap_flush *cf; cf = kmem_cache_alloc(ceph_cap_flush_cachep, GFP_KERNEL); + if (!cf) + return NULL; + cf->is_capsnap = false; return cf; }