From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757138AbcBWIvT (ORCPT ); Tue, 23 Feb 2016 03:51:19 -0500 Received: from foss.arm.com ([217.140.101.70]:35042 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752089AbcBWIvS (ORCPT ); Tue, 23 Feb 2016 03:51:18 -0500 Subject: Re: [PATCH] irqchip/gicv3-its: Don't allow devices whose ID is outside range To: Shanker Donthineni , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1456199868-9054-1-git-send-email-shankerd@codeaurora.org> Cc: Vikram Sethi , Thomas Gleixner , Jason Cooper From: Marc Zyngier Organization: ARM Ltd Message-ID: <56CC1D83.4060503@arm.com> Date: Tue, 23 Feb 2016 08:51:15 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <1456199868-9054-1-git-send-email-shankerd@codeaurora.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/02/16 03:57, Shanker Donthineni wrote: > We are not checking whether the requested device identifier fits into > table or not. The ITS MAPD command fails if 'Device ID' is outside of > device table range. > > Add a simple validation check to avoid MAPD failures since we are > not handling ITS command errors. This change also helps to return an > error -ENOMEM instead of success to caller. > In which circumstances do you see this failing? We allocate memory for the whole DevID range (as advertised by the ITS), so anything that comes up outside of that range cannot be handled anyway, and is a HW integration issue. You might as well pretend that these devices do not exist. Thanks, M. -- Jazz is not dead. It just smells funny...