Skip to content

Commit b3852ae

Browse files
lategoodbyekuba-moo
authored andcommitted
net: ethernet: oa_tc6: Handle failure of spi_setup
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 <[email protected]> Cc: [email protected] Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0704a3d commit b3852ae

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)