public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Fourier <fourier.thomas@gmail.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: stable@vger.kernel.org, Vincent Mailhol <mailhol@kernel.org>,
	Wolfgang Grandegger <wg@grandegger.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-can@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] can: sja1000: Fix pci_iounmap() buffer
Date: Tue, 7 Apr 2026 15:15:00 +0200	[thread overview]
Message-ID: <0746a585-710c-4bf0-b54a-41573d56a2e5@gmail.com> (raw)
In-Reply-To: <20260401-effective-piculet-of-will-704d4d-mkl@pengutronix.de>

On 01/04/2026 12:59, Marc Kleine-Budde wrote:
> The cleanup functions in this driver are a mess. kvaser_pci_del_chan()
> should only delete one channel, but it deletes all. It also unmaps the
> iomem, which belongs into kvaser_pci_remove_one().
I'm not quite sure because  kvaser_pci_init_one() allocs and registers all 
channels, so kvaser_pci_remove_one() should too?

> What about switching the driver to pcim_enable_device(),
> pcim_request_region(), pcim_iomap() functions instead?
I can write a second patch to do so, this would for sure solve the problem. 
Should I? I have no way to test it.

> When called from kvaser_pci_remove_one(), "dev" points to the master
> dev, which uses priv->reg_base without an offset, as it's board->channel
> is "0", right?
I think you are right, the normal path is fine, but not in the error paths for 
devices with channel other than 0.

Regards,
Thomas

> When called from the error path of kvaser_pci_add_chan(), things go
> wrong, and in the error path of kvaser_pci_init_one(), the pci mem is
> unmapped again.
>
> regards,
> Marc
>


      reply	other threads:[~2026-04-07 13:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 15:42 [PATCH net] can: sja1000: Fix pci_iounmap() buffer Thomas Fourier
2026-03-31  8:52 ` Markus Elfring
2026-04-01 10:59 ` Marc Kleine-Budde
2026-04-07 13:15   ` Thomas Fourier [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=0746a585-710c-4bf0-b54a-41573d56a2e5@gmail.com \
    --to=fourier.thomas@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=stable@vger.kernel.org \
    --cc=wg@grandegger.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