Thread (16 messages) 16 messages, 2 authors, 2016-10-05

RE: [net-next 08/13] fsl/fman: check pcsphy pointer before use

From: David Laight <hidden>
Date: 2016-10-04 14:46:40
Also in: lkml, netdev

From: Madalin Bucur
Sent: 04 October 2016 08:33
Subject: [net-next 08/13] fsl/fman: check pcsphy pointer before use
..
quoted hunk ↗ jump to hunk
--- a/drivers/net/ethernet/freescale/fman/fman_memac.c
+++ b/drivers/net/ethernet/freescale/fman/fman_memac.c
@@ -507,6 +507,9 @@ static void setup_sgmii_internal_phy(struct fman_mac =
*memac,
 {
 	u16 tmp_reg16;
=20
+	if (WARN_ON(!memac->pcsphy))
+		return;
+
Why?

Either it can validly be NULL in which case you don't want the message.
Or it shouldn't be NULL in which case you need to find and fix the bug.
The later kernel OOPS will make the bug much easier to find.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help