lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 13 Jun 2018 07:04:10 +0100
From:   Colin King <colin.king@...onical.com>
To:     "David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] WAN: LMC: ensure lmc_trace is reporting return from lmc_proto_type

From: Colin Ian King <colin.king@...onical.com>

Currently the lmc tracing is not reporting the return from function
lmc_proto_type and this tracing statement is never executed. Fix
this by returning through the end of the function.  Also fix a typo
in the function name lmc_proto_type in the trace message.

Detected by CoverityScan, CID#710539 ("Structurally dead code")

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 drivers/net/wan/lmc/lmc_proto.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wan/lmc/lmc_proto.c b/drivers/net/wan/lmc/lmc_proto.c
index 5a6c87bce1bf..b98c1ee860de 100644
--- a/drivers/net/wan/lmc/lmc_proto.c
+++ b/drivers/net/wan/lmc/lmc_proto.c
@@ -99,23 +99,27 @@ void lmc_proto_close(lmc_softc_t *sc)
 
 __be16 lmc_proto_type(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/
 {
+	__be16 ret;
+
 	lmc_trace(sc->lmc_device, "lmc_proto_type in");
 	switch (sc->if_type) {
 	case LMC_PPP:
-		return hdlc_type_trans(skb, sc->lmc_device);
+		ret = hdlc_type_trans(skb, sc->lmc_device);
 		break;
 	case LMC_NET:
-		return htons(ETH_P_802_2);
+		ret = htons(ETH_P_802_2);
 		break;
 	case LMC_RAW: /* Packet type for skbuff kind of useless */
-		return htons(ETH_P_802_2);
+		ret = htons(ETH_P_802_2);
 		break;
 	default:
 		printk(KERN_WARNING "%s: No protocol set for this interface, assuming 802.2 (which is wrong!!)\n", sc->name);
-		return htons(ETH_P_802_2);
+		ret = htons(ETH_P_802_2);
 		break;
 	}
-	lmc_trace(sc->lmc_device, "lmc_proto_tye out");
+	lmc_trace(sc->lmc_device, "lmc_proto_type out");
+
+	return ret;
 }
 
 void lmc_proto_netif(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/
-- 
2.17.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ