Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752850AbdGYQFi (ORCPT ); Tue, 25 Jul 2017 12:05:38 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:35029 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752540AbdGYQFh (ORCPT ); Tue, 25 Jul 2017 12:05:37 -0400 Date: Tue, 25 Jul 2017 18:05:33 +0200 From: Christian Kellner Subject: Re: [PATCH v2] thunderbolt: Do not enumerate more ports from DROM than the controller has To: Mika Westerberg Cc: Greg Kroah-Hartman , Andreas Noever , Michael Jamet , Yehezkel Bernat , Lukas Wunner , linux-kernel@vger.kernel.org Message-Id: <1500998733.3327.2@smtp.gmail.com> In-Reply-To: <20170725144158.23806-1-mika.westerberg@linux.intel.com> References: <20170725144158.23806-1-mika.westerberg@linux.intel.com> X-Mailer: geary/0.11.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 581 Lines: 24 Hi everyone, > + /* > + * Some DROMs list more ports than the controller actually has > + * so we skip those but allow the parser to continue. > + */ > + if (header->index > sw->config.max_port_number) { > + dev_info_once(&sw->dev, "ignoring unnecessary extra entries in > DROM\n"); > + return 0; > + } > + > port = &sw->ports[header->index]; > port->disabled = header->port_disabled; > if (port->disabled) Fixes the bug, everything works as expected (tested on boot, plugging in, key based authorization), so: Tested-by: Christian Kellner