mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Sasha Levin <sashal@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Wei Chen <harperchen1110@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	serjk@netup.ru, aospan@netup.ru, linux-media@vger.kernel.org
Subject: Re: [PATCH AUTOSEL 4.14 09/20] media: netup_unidvb: fix irq init by register it at the end of probe
Date: Fri, 16 Jun 2023 21:20:24 +0200	[thread overview]
Message-ID: <ZIy1+CA55P2YC4xA@duo.ucw.cz> (raw)
In-Reply-To: <20230525184520.2004878-9-sashal@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]

Hi!

> [ Upstream commit e6ad6233592593079db5c8fa592c298e51bc1356 ]
> 
> IRQ handler netup_spi_interrupt() takes spinlock spi->lock. The lock
> is initialized in netup_spi_init(). However, irq handler is registered
> before initializing the lock.
> 
> Spinlock dma->lock and i2c->lock suffer from the same problem.
> 
> Fix this by registering the irq at the end of probe.

Are you sure you got the error handling right? AFAICT
netup_unidvb_dma_fini(ndev, 0/1); is needed here.

Best regards,
								Pavel

> +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
> @@ -943,6 +938,14 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
>  		dev_err(&pci_dev->dev, "netup_unidvb: DMA setup failed\n");
>  		goto dma_setup_err;
>  	}
> +
> +	if (request_irq(pci_dev->irq, netup_unidvb_isr, IRQF_SHARED,
> +			"netup_unidvb", pci_dev) < 0) {
> +		dev_err(&pci_dev->dev,
> +			"%s(): can't get IRQ %d\n", __func__, pci_dev->irq);
> +		goto dma_setup_err;
> +	}
> +
>  	dev_info(&pci_dev->dev,
>  		"netup_unidvb: device has been initialized\n");
>  	return 0;
> @@ -961,8 +964,6 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
>  	dma_free_coherent(&pci_dev->dev, ndev->dma_size,
>  			ndev->dma_virt, ndev->dma_phys);
>  dma_alloc_err:
> -	free_irq(pci_dev->irq, pci_dev);
> -irq_request_err:
>  	iounmap(ndev->lmmio1);
>  pci_bar1_error:
>  	iounmap(ndev->lmmio0);

-- 
People of Russia, stop Putin before his war on Ukraine escalates.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2023-06-16 19:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 18:44 [PATCH AUTOSEL 4.14 01/20] ASoC: dwc: limit the number of overrun messages Sasha Levin
2023-05-25 18:44 ` [PATCH AUTOSEL 4.14 02/20] ASoC: ssm2602: Add workaround for playback distortions Sasha Levin
2023-05-25 18:44 ` [PATCH AUTOSEL 4.14 03/20] media: dvb-usb: az6027: fix three null-ptr-deref in az6027_i2c_xfer() Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 04/20] media: dvb-usb-v2: ec168: fix null-ptr-deref in ec168_i2c_xfer() Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 05/20] media: dvb-usb-v2: ce6230: fix null-ptr-deref in ce6230_i2c_master_xfer() Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 06/20] media: dvb-usb-v2: rtl28xxu: fix null-ptr-deref in rtl28xxu_i2c_xfer Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 07/20] media: dvb-usb: digitv: fix null-ptr-deref in digitv_i2c_xfer() Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 08/20] media: dvb-usb: dw2102: fix uninit-value in su3000_read_mac_address Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 09/20] media: netup_unidvb: fix irq init by register it at the end of probe Sasha Levin
2023-06-16 19:20   ` Pavel Machek [this message]
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 10/20] media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb() Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 11/20] media: dvb-core: Fix kernel WARNING for blocking operation in wait_event*() Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 12/20] media: dvb-core: Fix use-after-free due to race condition at dvb_ca_en50221 Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 13/20] wifi: rtl8xxxu: fix authentication timeout due to incorrect RCR value Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 14/20] arm64/mm: mark private VM_FAULT_X defines as vm_fault_t Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 15/20] scsi: core: Decrease scsi_device's iorequest_cnt if dispatch failed Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 16/20] wifi: b43: fix incorrect __packed annotation Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 17/20] netfilter: conntrack: define variables exp_nat_nla_policy and any_addr with CONFIG_NF_NAT Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 18/20] ALSA: oss: avoid missing-prototype warnings Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 19/20] atm: hide unused procfs functions Sasha Levin
2023-05-25 18:45 ` [PATCH AUTOSEL 4.14 20/20] mdio_bus: unhide mdio_bus_init prototype Sasha Levin
2023-05-25 20:05   ` Arnd Bergmann
2023-06-01  9:27     ` Sasha Levin

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=ZIy1+CA55P2YC4xA@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=aospan@netup.ru \
    --cc=harperchen1110@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sashal@kernel.org \
    --cc=serjk@netup.ru \
    --cc=stable@vger.kernel.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

all inboxes | Powered by JetHome®