From: David Miller <davem@davemloft.net>
To: ubraun@linux.ibm.com
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
raspl@linux.ibm.com
Subject: Re: [PATCH net 1/1] net/smc: save link group ptr before calling smc_buf_unuse
Date: Tue, 23 Oct 2018 11:00:57 -0700 (PDT) [thread overview]
Message-ID: <20181023.110057.1998437403503010569.davem@davemloft.net> (raw)
In-Reply-To: <20181023134805.2429-1-ubraun@linux.ibm.com>
From: Ursula Braun <ubraun@linux.ibm.com>
Date: Tue, 23 Oct 2018 15:48:05 +0200
> @@ -315,6 +314,8 @@ static void smc_buf_unuse(struct smc_connection *conn)
> /* remove a finished connection from its link group */
> void smc_conn_free(struct smc_connection *conn)
> {
> + struct smc_link_group *lgr;
> +
> if (!conn->lgr)
> return;
> if (conn->lgr->is_smcd) {
> @@ -323,8 +324,9 @@ void smc_conn_free(struct smc_connection *conn)
> } else {
> smc_cdc_tx_dismiss_slots(conn);
> }
> + lgr = conn->lgr; /* smc_lgr_unregister_conn() unsets lgr */
> smc_lgr_unregister_conn(conn);
> - smc_buf_unuse(conn);
> + smc_buf_unuse(conn, lgr);
> }
This doesn't make any sense.
smc_lgr_unregister_conn() can free the memory and release the object,
albeit sometimes asynchronously via a workqueue.
It is not safe, therefore, to refrence the lgr object after that
function call.
I'm not applying this, sorry.
prev parent reply other threads:[~2018-10-24 2:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-23 13:48 [PATCH net 1/1] net/smc: save link group ptr before calling smc_buf_unuse Ursula Braun
2018-10-23 18:00 ` David Miller [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=20181023.110057.1998437403503010569.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raspl@linux.ibm.com \
--cc=schwidefsky@de.ibm.com \
--cc=ubraun@linux.ibm.com \
/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