From patchwork Sun Jul 31 08:24:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 9253307 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B1496048F for ; Sun, 31 Jul 2016 08:28:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48DD4283F1 for ; Sun, 31 Jul 2016 08:28:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3965728481; Sun, 31 Jul 2016 08:28:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C2F92283F1 for ; Sun, 31 Jul 2016 08:28:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bTm3q-0002b4-L8; Sun, 31 Jul 2016 08:25:26 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bTm3n-0001PW-JR for linux-arm-kernel@lists.infradead.org; Sun, 31 Jul 2016 08:25:24 +0000 Received: from LT002.fritz.box ([109.91.48.91]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LsChr-1bHqqR1j9L-013tPj; Sun, 31 Jul 2016 10:24:36 +0200 From: Heinrich Schuchardt To: Florian Fainelli , bcm-kernel-feedback-list@broadcom.com Subject: [PATCH 1/1] net: bcm63xx: avoid possible null pointer dereference Date: Sun, 31 Jul 2016 10:24:29 +0200 Message-Id: <1469953469-20782-1-git-send-email-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.8.1 X-Provags-ID: V03:K0:TexkY5MCNoeKqRUuVjko9gQJ6XkuWcfIb+onToyVu7s6TZVAcXg 1m2fAI/YfR2qY+hEolcluSrTHgFBYX4Qrw1QNNd9JUSLdcTHLue8Z/PWVlixXix78+m3enC Rkpa8oZgv2nJX4JE5xa6zSIgS8ADkoczLe4cuad43niZwYRA8K8SX5+1FAsLasWUC2rP1N5 R8DGOMVse/0mXe7yzlZqA== X-UI-Out-Filterresults: notjunk:1; V01:K0:2XDoy2EK0TY=:7Po9WsUHiEX62wSKVU4SW2 M766j3yZUMs3+dEMLOC7dQYcH56uMIeAYYQPC7HXTIqDCVxSkEdgm8DH8lAaHiIvUyL+dSOOy LM5Igk6P5tYCwNyX35RIhLb5yOjCN2milhdc1T4YfcDVUtJeiRxyxM2ziJUZhDPaicRFDlbyB Z1Wv7SmwndFs7Zhb673YpN6fsOWLZ652Swor6k8nZM/28Lt7rrdPDgooeq1o5bZlF0dBpJXI/ SqzdvWY9rO8J7A4WCJ99FwJFWxYHxA4yIUGRCTPaQdsGl+1reDrzkTUgNZ2k7Uzb1KXSvCiT7 RGeQlZQVt047omfoabxAxVVlIdmyyGwJu39XZ63FMezlhZKDol4C0N2qWE/Vvjn6gUMXiLqjV 6EMMqByyNEP41AUEN1mniOdjC9GnOvpvbhDu7b7lNFJ3KOpvw3uAPK9W/t6W8xydeqZrsxd4Q 1flGy64HGNuKwgw8RG/0x5z6DUk9KFtYbNTQu8dc81i+FMSGKF8UlWL4oqcJFvKe+nLrAWn2Y 7/vIDFf1VKZA87P2W1gqvv4WCpg0u6oau/52ZNC5tjNjE8/iczeYtda23P87Z7lydT0DJEaVA 2pej4a9ShyuQXlUssu2YGuyOKRE/KS77Btx7NnBPhTjnLoVg7pRxXo1ZYKMl5zHNVKFOK1+Jq WCa8WEFZI5hNFRqx5K81t8eP0nETW5PDSeueG+cFnptLfKADd9PzFaNEGl2LE7S+wJcQcA66N o+4ijzw0W7etAdoWegMDotBH3ChmRSVu3tL5JVHtNk5H54NFIc77ILy9rcc= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160731_012523_970320_4D476150 X-CRM114-Status: UNSURE ( 8.40 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ivan Vecera , Andrew Lunn , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Heinrich Schuchardt , Simon Arlott , Thierry Reding , "David S . Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If dev_get_platdata has failed pd is null. Do not dereference a null pointer. Signed-off-by: Heinrich Schuchardt --- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 87c6b5b..6c8bc5f 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -1859,7 +1859,7 @@ static int bcm_enet_probe(struct platform_device *pdev) } else { /* run platform code to initialize PHY device */ - if (pd->mii_config && + if (pd && pd->mii_config && pd->mii_config(dev, 1, bcm_enet_mdio_read_mii, bcm_enet_mdio_write_mii)) { dev_err(&pdev->dev, "unable to configure mdio bus\n");