From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753307AbcJDOqk convert rfc822-to-8bit (ORCPT ); Tue, 4 Oct 2016 10:46:40 -0400 Received: from smtp-out6.electric.net ([192.162.217.191]:50184 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648AbcJDOqj (ORCPT ); Tue, 4 Oct 2016 10:46:39 -0400 From: David Laight To: "'madalin.bucur@nxp.com'" , "netdev@vger.kernel.org" CC: "linuxdev.baldrick@gmail.com" , "linuxppc-dev@lists.ozlabs.org" , "davem@davemloft.net" , "linux-kernel@vger.kernel.org" Subject: RE: [net-next 08/13] fsl/fman: check pcsphy pointer before use Thread-Topic: [net-next 08/13] fsl/fman: check pcsphy pointer before use Thread-Index: AQHSHhOFv+ruxr5hTEy0SLj0/o6ZbKCYXtnQ Date: Tue, 4 Oct 2016 14:44:12 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB01E2ED3@AcuExch.aculab.com> References: <1475566379-5078-1-git-send-email-madalin.bucur@nxp.com> <1475566379-5078-9-git-send-email-madalin.bucur@nxp.com> In-Reply-To: <1475566379-5078-9-git-send-email-madalin.bucur@nxp.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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