]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: fix leak in osd reply messages
authorYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 20 Oct 2008 18:23:42 +0000 (11:23 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 20 Oct 2008 18:23:49 +0000 (11:23 -0700)
src/kernel/osd_client.c

index 3cc63a1020e80d7c0939e23c847ca1a706bd66e6..b51567f99ff39144f545871ce09b9a7507982f51 100644 (file)
@@ -75,7 +75,10 @@ void ceph_osdc_put_request(struct ceph_osd_request *req)
             atomic_read(&req->r_ref)-1);
        BUG_ON(atomic_read(&req->r_ref) <= 0);
        if (atomic_dec_and_test(&req->r_ref)) {
-               ceph_msg_put(req->r_request);
+               if (req->r_request)
+                       ceph_msg_put(req->r_request);
+               if (req->r_reply)
+                       ceph_msg_put(req->r_reply);
                ceph_put_snap_context(req->r_snapc);
                kfree(req);
        }