mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 14:30:06 -04:00
net: ethernet: oa_tc6: Handle failure of spi_setup
There is no guarantee that spi_setup succeed, so properly handle
the error case.
Fixes: aa58bec064 ("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>
This commit is contained in:
committed by
Jakub Kicinski
parent
0704a3da7c
commit
b3852ae310
@@ -1249,7 +1249,8 @@ struct oa_tc6 *oa_tc6_init(struct spi_device *spi, struct net_device *netdev)
|
||||
|
||||
/* Set the SPI controller to pump at realtime priority */
|
||||
tc6->spi->rt = true;
|
||||
spi_setup(tc6->spi);
|
||||
if (spi_setup(tc6->spi) < 0)
|
||||
return NULL;
|
||||
|
||||
tc6->spi_ctrl_tx_buf = devm_kzalloc(&tc6->spi->dev,
|
||||
OA_TC6_CTRL_SPI_BUF_SIZE,
|
||||
|
||||
Reference in New Issue
Block a user