public inbox for linux-can@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: linux-can@vger.kernel.org, tglx@linutronix.de,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: Re: [PATCH] can: gw: fix RCU/BH usage in cgw_create_job()
Date: Tue, 29 Apr 2025 09:03:01 +0200	[thread overview]
Message-ID: <20250429070301.AwIEDSN1@linutronix.de> (raw)
In-Reply-To: <f7551463-1fe4-41e6-bd7c-1b99111a7e46@hartkopp.net>

On 2025-04-28 22:11:48 [+0200], Oliver Hartkopp wrote:
> Hi Sebastian,
Hi Oliver,

> thanks for your interesting work!
> 
> I have one comment/question inline ...
> 
> On 17.04.25 16:41, Sebastian Andrzej Siewior wrote:
> 
> >   	err = cgw_register_filter(net, gwj);
> > -	if (!err)
> > +	if (!err) {
> >   		hlist_add_head_rcu(&gwj->list, &net->can.cgw_list);
> > +		mod = NULL;
> 
> I assume this assignment prevents to kfree() the assigned mod data some
> lines below, right?

Yes, that is the reason but I think I can do better.

> If so there should be a comment why this assignment was made.
> 
> > +	}
> >   out:
> >   	if (err)
> >   		kmem_cache_free(cgw_cache, gwj);
> > -
> > +out_free_cf:
> > +	kfree(mod);  <<<<<<<<<< HERE <<<<<<<<<<
> >   	return err;
> >   }
> 
> You can also add my
> 
> Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
> 
> Many thanks,
> Oliver

Sebastian

      reply	other threads:[~2025-04-29  7:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17 14:41 [PATCH] can: gw: fix RCU/BH usage in cgw_create_job() Sebastian Andrzej Siewior
2025-04-28 20:11 ` Oliver Hartkopp
2025-04-29  7:03   ` Sebastian Andrzej Siewior [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=20250429070301.AwIEDSN1@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    --cc=tglx@linutronix.de \
    /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