Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754256AbcDSN5X (ORCPT ); Tue, 19 Apr 2016 09:57:23 -0400 Received: from mail1.bemta3.messagelabs.com ([195.245.230.166]:38504 "EHLO mail1.bemta3.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753358AbcDSN5V (ORCPT ); Tue, 19 Apr 2016 09:57:21 -0400 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFIsWRWlGSWpSXmKPExsVyU6aHU9fUUiz c4Nt+EYuVU1gsLu+aw2Yxe0k/i8XVB+UWxxaIWey/4uXA5vHt6yQWj+M3tjN5fN4kF8AcxZqZ l5RfkcCasePHBOaCi6wVTRs0GxjPsnQxcnEICWxglLg3+zJjFyMnB5uAmcSuV+vYQWwRARmJo /0L2ECKmAX2Mkocb57ACpIQFoiRWD//HZjNIqAqcf34eRYQm1fAT+Lf399Agzg4JATkJBZcSI cIC0qcnPkErIRZQELi4IsXzCC2kIC2xPI9fWC7JAQUJGav2sAEYadI/Dr2jxHCtpZo+/uBfQI j3ywko2YhGbWAkWkVo3pxalFZapGusV5SUWZ6RkluYmaOrqGBsV5uanFxYnpqTmJSsV5yfu4m RmA4MgDBDsbmL06HGCU5mJREeaOYxMKF+JLyUyozEosz4otKc1KLDzHKcHAoSfAaWADlBItS0 1Mr0jJzgJEBk5bg4FES4dUGSfMWFyTmFmemQ6ROMepyLPhxey2TEEtefl6qlDivF0iRAEhRRm ke3AhYlF5ilJUS5mUEOkqIpyC1KDezBFX+FaM4B6OSMK8OyBSezLwSuE2vgI5gAjqC/64oyBE liQgpqQZGT8Hvi94Eiba6hHtfb98YePDU71/HH7AmGzlJxcQ3SnBx6aT/vyQlkrc2qTTW6lHY DMW67t4vvAurXVZv/nSvPvXsaovp96ewiIkf/HhT58Npvze7KlaXZqpcWKHEkiWhvFzKqvj0h ovL/jIXiE1VzT8x8fhkz4z62wlvu6d9m2m5WjfhWcVjJZbijERDLeai4kQAlXyVAM0CAAA= X-Env-Sender: andrew.goodbody@cambrionix.com X-Msg-Ref: server-10.tower-140.messagelabs.com!1461074223!27884662!16 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 v2 0/1] drivers: net: cpsw: Fix NULL pointer dereference with two slave PHYs Date: Tue, 19 Apr 2016 14:56:25 +0100 Message-ID: <1461074186-25535-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: 720 Lines: 18 Resend to add more people on Cc: as requested by Grygrii Strashko. 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. v1 had a problem that data->slaves was used before it had been filled in Andrew Goodbody (1): Prevent NUll pointer dereference with two PHYs on cpsw drivers/net/ethernet/ti/cpsw.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) -- 2.5.0