The function srpt_cm_req_recv() now returns an error code instead of 0
authorbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Sun, 26 Apr 2009 09:10:52 +0000 (09:10 +0000)
committerbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Sun, 26 Apr 2009 09:10:52 +0000 (09:10 +0000)
when an SRP login request is rejected. This fixes a memory leak: the
InfiniBand core (drivers/infiniband/core/cm.c) only calls cm_free_work()
when the registered cm_handler function, i.e. srpt_cm_req_recv()
returns an error code. This patch has been submitted by by Frank Zago.

git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@800 d57e44dd-8a1f-0410-8b47-8ef2f437770f

srpt/src/ib_srpt.c

index 3f8a3e9..0a94f90 100644 (file)
@@ -1368,7 +1368,7 @@ reject:
        rej->buf_fmt =
            cpu_to_be16(SRP_BUF_FORMAT_DIRECT | SRP_BUF_FORMAT_INDIRECT);
 
-       ret = ib_send_cm_rej(cm_id, IB_CM_REJ_CONSUMER_DEFINED, NULL, 0,
+       ib_send_cm_rej(cm_id, IB_CM_REJ_CONSUMER_DEFINED, NULL, 0,
                             (void *)rej, sizeof *rej);
 
 out: