PCMCIA odd cleanups and fixes for v6.7-rc1

Yang Yingliang has fixed a number of resource leaks and Dongliang Mu
 contributed a spelling fix for the PCMCIA core. Also included is a tiny
 clenaup to the tcic PCMCIA socket driver provided by lizhe.
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEmgXaWKgmjrvkPhLCmpdgiUyNow0FAmVJOTobHGxpbnV4QGRv
 bWluaWticm9kb3dza2kubmV0AAoJEJqXYIlMjaMNzmoP/3VRbLdCvs+8DER/Cpe/
 fKZtmO0SndQXHXC853ilSSxiXRcsnLlAa9bC2vydxU/g0csB78nyZhUXysMsB42O
 eOG+hDL5KoG2YeS90wogIVwwdP9LuWvaCbhe0pPdc9/iU9x8fiIx+voPxGu8gV5U
 lmqO2a772IchhejbkX6YQbGmWK/6r81+6nKXisyXwcbBNICyRUFtPRGCySDXTTWM
 d+Nt/8p311YeyVRrRkjb7lUCN5ww1WRLulHrm+3GTInWM/j9jtr/CCj6Czo2ABym
 Mbcbk9oQSE0y/BcsfDqYh8YKPUMqRHss16K3LGRGQbcu6O7XoLwLDAuxxg04eeNL
 QIu2iDnSt3s4L3zUut1TQXjpGccS/s69aQeL/GSTDC7njG+OFR4r62FB2AE+6lRq
 1EaJlwBjTmyeZi8uqWFcli+eO3qYoZXfn3kMABE2Z0JOdJ0YO7Q1dZMOwVj76SbI
 K7oi9DOgmIwVjOyJml4peC7GG4hy4Fad4f7zTdHhPlqpwm40Eh2gQAjM4hj4/eQq
 eGr1dSROzQamuUMv6IATg4syNATszNDk5cEJY0I2HMc3vhyNPx1dUW3jZjzNPb9B
 l08sBASr0PAXc80DPdnO/s2J7VHZjS9x9KBdfYSbOlsYBdi9K/+u3ohb62d2ySBf
 7J4REp30lm6JjWiVhtRMQYOn
 =TMdA
 -----END PGP SIGNATURE-----

Merge tag 'pcmcia-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux

Pull PCMCIA updates from Dominik Brodowski:
 "Cleanups and fixes.

  Yang Yingliang has fixed a number of resource leaks and Dongliang Mu
  contributed a spelling fix for the PCMCIA core. Also included is a
  tiny clenaup to the tcic PCMCIA socket driver provided by lizhe"

* tag 'pcmcia-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux:
  pcmcia: tcic: remove unneeded "&" in call to setup_timer()
  pcmcia: typo fix
  pcmcia: ds: fix possible name leak in error path in pcmcia_device_add()
  pcmcia: ds: fix refcount leak in pcmcia_device_add()
  pcmcia: cs: fix possible hung task and memory leak pccardd()
This commit is contained in:
Linus Torvalds 2023-11-07 16:40:42 -08:00
commit d3fbdb8ad3
4 changed files with 12 additions and 7 deletions

View File

@ -605,6 +605,7 @@ static int pccardd(void *__skt)
dev_warn(&skt->dev, "PCMCIA: unable to register socket\n");
skt->thread = NULL;
complete(&skt->thread_done);
put_device(&skt->dev);
return 0;
}
ret = pccard_sysfs_add_socket(&skt->dev);

View File

@ -513,9 +513,6 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s,
/* by default don't allow DMA */
p_dev->dma_mask = 0;
p_dev->dev.dma_mask = &p_dev->dma_mask;
dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no);
if (!dev_name(&p_dev->dev))
goto err_free;
p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev));
if (!p_dev->devname)
goto err_free;
@ -573,8 +570,15 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s,
pcmcia_device_query(p_dev);
if (device_register(&p_dev->dev))
goto err_unreg;
dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no);
if (device_register(&p_dev->dev)) {
mutex_lock(&s->ops_mutex);
list_del(&p_dev->socket_device_list);
s->device_count--;
mutex_unlock(&s->ops_mutex);
put_device(&p_dev->dev);
return NULL;
}
return p_dev;

View File

@ -684,7 +684,7 @@ EXPORT_SYMBOL(pcmcia_request_io);
* pcmcia_request_irq() is a wrapper around request_irq() which allows
* the PCMCIA core to clean up the registration in pcmcia_disable_device().
* Drivers are free to use request_irq() directly, but then they need to
* call free_irq() themselfves, too. Also, only %IRQF_SHARED capable IRQ
* call free_irq() themselves, too. Also, only %IRQF_SHARED capable IRQ
* handlers are allowed.
*/
int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,

View File

@ -435,7 +435,7 @@ static int __init init_tcic(void)
}
/* Set up polling */
timer_setup(&poll_timer, &tcic_timer, 0);
timer_setup(&poll_timer, tcic_timer, 0);
/* Build interrupt mask */
printk(KERN_CONT ", %d sockets\n", sockets);