netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fsl_ucc_hdlc: add a check of the return value from hdlc_open
@ 2023-08-25 14:31 Alexandra Diupina
  2023-08-26  6:32 ` Christophe Leroy
  0 siblings, 1 reply; 16+ messages in thread
From: Alexandra Diupina @ 2023-08-25 14:31 UTC (permalink / raw)
  To: Zhao Qiang
  Cc: Alexandra Diupina, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linuxppc-dev, linux-kernel, lvc-project

Process the result of hold_open() and return it from
uhdlc_open() in case of an error
It is necessary to pass the error code up the control flow,
similar to a possible error in request_irq()

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: c19b6d246a35 ("drivers/net: support hdlc function for QE-UCC")
Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
---
 drivers/net/wan/fsl_ucc_hdlc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
index 47c2ad7a3e42..cdd9489c712e 100644
--- a/drivers/net/wan/fsl_ucc_hdlc.c
+++ b/drivers/net/wan/fsl_ucc_hdlc.c
@@ -708,6 +708,7 @@ static int uhdlc_open(struct net_device *dev)
 	hdlc_device *hdlc = dev_to_hdlc(dev);
 	struct ucc_hdlc_private *priv = hdlc->priv;
 	struct ucc_tdm *utdm = priv->utdm;
+	int rc = 0;
 
 	if (priv->hdlc_busy != 1) {
 		if (request_irq(priv->ut_info->uf_info.irq,
@@ -731,10 +732,12 @@ static int uhdlc_open(struct net_device *dev)
 		napi_enable(&priv->napi);
 		netdev_reset_queue(dev);
 		netif_start_queue(dev);
-		hdlc_open(dev);
+		rc = hdlc_open(dev);
+		if (rc)
+			return rc;
 	}
 
-	return 0;
+	return rc;
 }
 
 static void uhdlc_memclean(struct ucc_hdlc_private *priv)
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-09-22  7:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-25 14:31 [PATCH] fsl_ucc_hdlc: add a check of the return value from hdlc_open Alexandra Diupina
2023-08-26  6:32 ` Christophe Leroy
2023-08-28  8:27   ` [PATCH v2] " Alexandra Diupina
2023-08-28  8:37     ` Christophe Leroy
2023-08-28 12:12       ` [PATCH v3] fsl_ucc_hdlc: process the result of hold_open() Alexandra Diupina
2023-08-28 13:11         ` Christophe Leroy
2023-08-28 19:38         ` Jakub Kicinski
2023-09-01 10:48           ` Александра Дюпина
2023-09-01 11:05             ` Denis Kirjanov
2023-09-04 12:31               ` [PATCH v4] drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close() Alexandra Diupina
2023-09-04 17:03                 ` Christophe Leroy
2023-09-04 17:04                   ` Christophe Leroy
2023-09-05 10:46                   ` Paolo Abeni
2023-09-19 14:25                     ` [PATCH v5] " Alexandra Diupina
2023-09-22  7:09                       ` Christophe Leroy
2023-09-22  7:20                       ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).