Skip to content

Commit d3fbdb8

Browse files
committed
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()
2 parents dc14348 + 4f733de commit d3fbdb8

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

drivers/pcmcia/cs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ static int pccardd(void *__skt)
605605
dev_warn(&skt->dev, "PCMCIA: unable to register socket\n");
606606
skt->thread = NULL;
607607
complete(&skt->thread_done);
608+
put_device(&skt->dev);
608609
return 0;
609610
}
610611
ret = pccard_sysfs_add_socket(&skt->dev);

drivers/pcmcia/ds.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,6 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s,
513513
/* by default don't allow DMA */
514514
p_dev->dma_mask = 0;
515515
p_dev->dev.dma_mask = &p_dev->dma_mask;
516-
dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no);
517-
if (!dev_name(&p_dev->dev))
518-
goto err_free;
519516
p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev));
520517
if (!p_dev->devname)
521518
goto err_free;
@@ -573,8 +570,15 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s,
573570

574571
pcmcia_device_query(p_dev);
575572

576-
if (device_register(&p_dev->dev))
577-
goto err_unreg;
573+
dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no);
574+
if (device_register(&p_dev->dev)) {
575+
mutex_lock(&s->ops_mutex);
576+
list_del(&p_dev->socket_device_list);
577+
s->device_count--;
578+
mutex_unlock(&s->ops_mutex);
579+
put_device(&p_dev->dev);
580+
return NULL;
581+
}
578582

579583
return p_dev;
580584

drivers/pcmcia/pcmcia_resource.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ EXPORT_SYMBOL(pcmcia_request_io);
684684
* pcmcia_request_irq() is a wrapper around request_irq() which allows
685685
* the PCMCIA core to clean up the registration in pcmcia_disable_device().
686686
* Drivers are free to use request_irq() directly, but then they need to
687-
* call free_irq() themselfves, too. Also, only %IRQF_SHARED capable IRQ
687+
* call free_irq() themselves, too. Also, only %IRQF_SHARED capable IRQ
688688
* handlers are allowed.
689689
*/
690690
int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,

drivers/pcmcia/tcic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static int __init init_tcic(void)
435435
}
436436

437437
/* Set up polling */
438-
timer_setup(&poll_timer, &tcic_timer, 0);
438+
timer_setup(&poll_timer, tcic_timer, 0);
439439

440440
/* Build interrupt mask */
441441
printk(KERN_CONT ", %d sockets\n", sockets);

0 commit comments

Comments
 (0)