mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
nfc: mrvl: spi: Unregister dev on allocation fail
Call nfcmrvl_nci_unregister_dev() if nci_spi_allocate_spi() fails, unwrapping the previous call to nfcmrvl_nci_register_dev() during the nfcmrvl_spi_probe() function. Assisted-by: gkh-clanker-2000 Cc: David Heidelberg <david@ixit.cz> Signed-off-by: Griffin Kroah-Hartman <griffin@kroah.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://patch.msgid.link/2026070716-crucial-slouchy-b8a9@gregkh Signed-off-by: David Heidelberg <david@ixit.cz>
This commit is contained in:
parent
9efd35acb3
commit
d832b95697
|
|
@ -168,6 +168,10 @@ static int nfcmrvl_spi_probe(struct spi_device *spi)
|
|||
|
||||
drv_data->nci_spi = nci_spi_allocate_spi(drv_data->spi, 0, 10,
|
||||
drv_data->priv->ndev);
|
||||
if (!drv_data->nci_spi) {
|
||||
nfcmrvl_nci_unregister_dev(drv_data->priv);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Init completion for slave handshake */
|
||||
init_completion(&drv_data->handshake_completion);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user