Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758611AbcDMOoc (ORCPT ); Wed, 13 Apr 2016 10:44:32 -0400 Received: from mail1.bemta3.messagelabs.com ([195.245.230.169]:5732 "EHLO mail1.bemta3.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758082AbcDMOoY (ORCPT ); Wed, 13 Apr 2016 10:44:24 -0400 X-Greylist: delayed 423 seconds by postgrey-1.27 at vger.kernel.org; Wed, 13 Apr 2016 10:44:24 EDT X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPIsWRWlGSWpSXmKPExsVyU6aHU3dqJF+ 4wfZbehaXd81hszi2QMyByePzJrkAxijWzLyk/IoE1ow1ywoKjrBUtP/8xtzAeIe5i5GLQ0hg A6PE5nkLgRxODjYBM4ldr9axg9giAjISR/sXsIHYzAKhErd/TgezhQU8JbqOPAWrZxFQlXi4o wnM5hXwlfjccYuxi5GDQ0JATmLBhXSIsKDEyZlPWCDGSEgcfPECrFxIQFti+Z4+sFUSAgoSs1 dtYIKwUyR+HfvHCGFbS7T9/cA+gZFvFpJRs5CMWsDItIpRozi1qCy1SNfQRC+pKDM9oyQ3MTN H19DAWC83tbg4MT01JzGpWC85P3cTIzCwGIBgB+OK7Z6HGCU5mJREebcF84UL8SXlp1RmJBZn xBeV5qQWH2KU4eBQkuBljQDKCRalpqdWpGXmAEMcJi3BwaMkwhsGkuYtLkjMLc5Mh0idYtTlW PDj9lomIZa8/LxUKXHeQpAiAZCijNI8uBGweLvEKCslzMsIdJQQT0FqUW5mCar8K0ZxDkYlYV 5ZkCk8mXklcJteAR3BBHRE2TtekCNKEhFSUg2MW7w6Vh+7rr/eJVNPVPtL8oF9t5dr/6hOFZY 6m37759tXtpXWnxIqJhg8ksj9a3CeUfXq2q6oc5cuyS7iPZnu9fWe6ge7y7bSak7asl++Pv9Y 9Y1P7/zF5zWmOiLNYbOminS7T5zKVf+yeALDBYZtR90yg4Nvbzu+cuqi2c4XpHg2n3uo58+Wq cRSnJFoqMVcVJwIAJC1qmOyAgAA X-Env-Sender: andrew.goodbody@cambrionix.com X-Msg-Ref: server-13.tower-139.messagelabs.com!1460558219!14641733!20 X-Originating-IP: [217.28.140.9] X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked From: Andrew Goodbody To: CC: , Andrew Goodbody Subject: [PATCH] Fix NULL pointer dereference in cpsw with two slave PHYs Date: Wed, 13 Apr 2016 15:36:47 +0100 Message-ID: <1460558208-1374-1-git-send-email-andrew.goodbody@cambrionix.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [46.17.166.30] X-ClientProxiedBy: SEHSTE15FE05.hs20.net (172.18.251.45) To THHSTE15D2BE2.hs20.net (192.168.251.32) X-EXCLAIMER-MD-CONFIG: 266e7a57-cddd-49fd-bdea-19bca6d40303 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 579 Lines: 14 This is a fix for a NULL pointer dereference from cpsw which is triggered by having two slave PHYs attached to a cpsw network device. The problem is due to only maintaining a single reference to a PHY node in the prive data which gets overwritten by the second PHY probe. So move the PHY node reference to the individual slave data so that there is now one per slave. Andrew Goodbody (1): Prevent NUll pointer dereference with two PHYs on cpsw drivers/net/ethernet/ti/cpsw.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) -- 2.5.0