Skip to content

Commit 18dc528

Browse files
lategoodbyegregkh
authored andcommitted
net: ethernet: oa_tc6: Handle failure of spi_setup
commit b3852ae upstream. There is no guarantee that spi_setup succeed, so properly handle the error case. Fixes: aa58bec ("net: ethernet: oa_tc6: implement register write operation") Signed-off-by: Stefan Wahren <wahrenst@gmx.net> Cc: stable@kernel.org Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20250827115341.34608-2-wahrenst@gmx.net Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e3d63ba commit 18dc528

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/oa_tc6.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,8 @@ struct oa_tc6 *oa_tc6_init(struct spi_device *spi, struct net_device *netdev)
12491249

12501250
/* Set the SPI controller to pump at realtime priority */
12511251
tc6->spi->rt = true;
1252-
spi_setup(tc6->spi);
1252+
if (spi_setup(tc6->spi) < 0)
1253+
return NULL;
12531254

12541255
tc6->spi_ctrl_tx_buf = devm_kzalloc(&tc6->spi->dev,
12551256
OA_TC6_CTRL_SPI_BUF_SIZE,

0 commit comments

Comments
 (0)