From: "ira.weiny" <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: Vladimir Koushnir
<vladimirk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
"linux-rdma
(linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2/2 infiniband-diags] ibqueryerrors: Resource leak in path_record_query
Date: Wed, 22 Apr 2015 10:57:51 -0400 [thread overview]
Message-ID: <20150422145750.GE28220@phlsvsds.ph.intel.com> (raw)
In-Reply-To: <55363F50.3050905-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
On Tue, Apr 21, 2015 at 08:15:12AM -0400, Hal Rosenstock wrote:
> From: Vladimir Koushnir <vladimirk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Date: Thu Apr 16 16:39:43 2015 +0300
>
> sa_free_handle function is not called at the end of
> path_record_query function.
> The patch fixes file descriptor leak when path_record_query
> function is called.
>
> Signed-off-by: Vladimir Koushnir <vladimirk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Applied Thanks,
Ira
> ---
> src/ibqueryerrors.c | 34 +++++++++++++++++++++++++++-------
> 1 files changed, 27 insertions(+), 7 deletions(-)
>
> diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
> index 9d9ec45..8fbb9d1 100644
> --- a/src/ibqueryerrors.c
> +++ b/src/ibqueryerrors.c
> @@ -344,6 +344,7 @@ static int path_record_query(ib_gid_t sgid,uint64_t dguid)
> (uint16_t)IB_SA_ATTR_PATHRECORD,0,cl_ntoh64(comp_mask),ibd_sakey,
> &pr, sizeof(pr), &result);
> if (ret) {
> + sa_free_handle(h);
> fprintf(stderr, "Query SA failed: %s; sa call path_query failed\n", strerror(ret));
> return ret;
> }
> @@ -355,6 +356,7 @@ static int path_record_query(ib_gid_t sgid,uint64_t dguid)
>
> insert_lid2sl_table(&result);
> Exit:
> + sa_free_handle(h);
> sa_free_result_mad(&result);
> return ret;
> }
> --
> 1.7.8.2
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-04-22 14:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-21 12:15 [PATCH 2/2 infiniband-diags] ibqueryerrors: Resource leak in path_record_query Hal Rosenstock
[not found] ` <55363F50.3050905-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-04-22 14:56 ` ira.weiny
2015-04-22 14:57 ` ira.weiny [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150422145750.GE28220@phlsvsds.ph.intel.com \
--to=ira.weiny-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=vladimirk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox