From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/1] IB/sa: Put netlink request into the request list before sending
Date: Wed, 28 Oct 2015 10:46:36 -0600 [thread overview]
Message-ID: <20151028164636.GB14310@obsidianresearch.com> (raw)
In-Reply-To: <1446039867-27883-1-git-send-email-kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
On Wed, Oct 28, 2015 at 09:44:27AM -0400, kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:
> ret = ib_nl_send_msg(query);
> + spin_lock_irqsave(&ib_nl_request_lock, flags);
Looks like query could be kfree'd before ib_nl_send_msg returns, eg by
send_handler?
> if (ret <= 0) {
> ret = -EIO;
> - goto request_out;
> + /* Remove the request */
> + list_del(&query->list);
This one is probably OK iff nl_send_msg cannot call send_handler if it
returns error, which looks true.
> } else {
> ret = 0;
> + /* Start the timeout if this is the only request */
> + if (ib_nl_request_list.next == &query->list)
This one looks sketchy. Maybe move this to the first locking block? A
extra timer on send error is not important enough to worry about..
Jason
--
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
next prev parent reply other threads:[~2015-10-28 16:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 13:44 [PATCH 1/1] IB/sa: Put netlink request into the request list before sending kaike.wan-ral2JQCrhuEAvxtiuMwx3w
[not found] ` <1446039867-27883-1-git-send-email-kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-10-28 15:39 ` ira.weiny
[not found] ` <20151028153949.GA10890-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-10-28 18:11 ` Wan, Kaike
2015-10-28 16:46 ` Jason Gunthorpe [this message]
[not found] ` <20151028164636.GB14310-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-10-29 11:38 ` Wan, Kaike
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=20151028164636.GB14310@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=kaike.wan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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;
as well as URLs for NNTP newsgroup(s).