[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB01E2ED3@AcuExch.aculab.com>
Date: Tue, 4 Oct 2016 14:44:12 +0000
From: David Laight <David.Laight@...LAB.COM>
To: "'madalin.bucur@....com'" <madalin.bucur@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "linuxdev.baldrick@...il.com" <linuxdev.baldrick@...il.com>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [net-next 08/13] fsl/fman: check pcsphy pointer before use
From: Madalin Bucur
> Sent: 04 October 2016 08:33
> Subject: [net-next 08/13] fsl/fman: check pcsphy pointer before use
..
> --- 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;
>
> + 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
Powered by blists - more mailing lists