From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9ECAC31E45 for ; Thu, 13 Jun 2019 06:54:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E45D20866 for ; Thu, 13 Jun 2019 06:54:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cegDUbXc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="yHWMPWdZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E45D20866 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ECYj9BmGps+BJ0aQMAN5GZrHfXnDuAKjuFYcBmMmCjI=; b=cegDUbXcKcp73W CdK0ba7xQ+6ZBOz5V4pfaJcbliDvrBi6css44PzRABHJG7xI//HH4EpU7xrp17i6+7aN2a6fwFxdY 93JYoFHzGCZ/vykCjUx2IgTucCOWrqRxWVGaPAh9CeVmKhZnM1/T6byAClYk2Dvni1g00DXszYIys YcAQ9P261tuhGywFNnWoZvQWlwon+bW/5ntsXt3L2GUEwZAvUH2YgLl1DzG0LzNyJQ43/W7K4/VOd xValFf2ICjOf3yxI6MoaydosxcAjcsHiAVvBw1/u/rs1rfOjYHlXs7tR5Nkha44llaCPX4mk8Vco4 TE5bkwa7cFW5mDbh0zRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbJd0-00047M-IK; Thu, 13 Jun 2019 06:54:30 +0000 Received: from userp2130.oracle.com ([156.151.31.86]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbJcx-00046s-Fc for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2019 06:54:28 +0000 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5D6sNAx011711; Thu, 13 Jun 2019 06:54:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=+p9bNSHm2Ncbv+ASm69GCpznMFNiwtbpe0dw2hqUkkA=; b=yHWMPWdZv/XtUu9DlTm5CxgFfps6bAs4TkRabP82B6j8j89SvriCL99WkWUw5S5VKCRX LJwfH2REQSETyo6FuM16gyjV2Bj/tFXcOA4XzmZWpRNHjvFpdsMx7+l0wnrazVQkIz5y i/ZEAXpiviIIzZKzF4ZRhi9ODUjtRi1PR3T6NPe2bspKL3MbRJ3DrLRDUXeGHJpEGkXc +xvSln+ZhEuZBmdAO6E1b5AX9AQ/ZMwTMOWuds2DNFDqPLmWhzn3n+jb/Acw0kF4H090 ytrFMfyqIoGUpi/rklBewd6MyKcCiIHaOryRExSBnKQsgEZhJqLLDc3GzqNVEWt+mSCW vQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2t04etymwr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2019 06:54:23 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5D6qqht075123; Thu, 13 Jun 2019 06:54:22 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2t1jpjcyut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2019 06:54:22 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x5D6sHww011651; Thu, 13 Jun 2019 06:54:21 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 12 Jun 2019 23:54:17 -0700 Date: Thu, 13 Jun 2019 09:54:10 +0300 From: Dan Carpenter To: tn@semihalf.com Subject: [bug report] ACPI: Add new IORT functions to support MSI domain handling Message-ID: <20190613065410.GB16334@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9286 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=934 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906130055 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9286 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=976 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906130055 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190612_235427_674904_116FB27E X-CRM114-Status: GOOD ( 13.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Tomasz Nowicki, The patch 4bf2efd26d76: "ACPI: Add new IORT functions to support MSI domain handling" from Sep 12, 2016, leads to the following static checker warning: drivers/acpi/arm64/iort.c:628 iort_dev_find_its_id() warn: array off by one? 'its->identifiers[idx]' drivers/acpi/arm64/iort.c 589 /** 590 * iort_dev_find_its_id() - Find the ITS identifier for a device 591 * @dev: The device. 592 * @req_id: Device's requester ID 593 * @idx: Index of the ITS identifier list. 594 * @its_id: ITS identifier. 595 * 596 * Returns: 0 on success, appropriate error value otherwise 597 */ 598 static int iort_dev_find_its_id(struct device *dev, u32 req_id, 599 unsigned int idx, int *its_id) 600 { 601 struct acpi_iort_its_group *its; 602 struct acpi_iort_node *node; 603 604 node = iort_find_dev_node(dev); 605 if (!node) 606 return -ENXIO; 607 608 node = iort_node_map_id(node, req_id, NULL, IORT_MSI_TYPE); 609 if (!node) 610 return -ENXIO; 611 612 /* Move to ITS specific data */ 613 its = (struct acpi_iort_its_group *)node->node_data; 614 if (idx > its->its_count) { ^^^^^^^^^^^^^^^^^^^^ I wasn't able to find any information about how its->its_count is set but it looks to me that is off by one. 615 dev_err(dev, "requested ITS ID index [%d] is greater than available [%d]\n", 616 idx, its->its_count); 617 return -ENXIO; 618 } 619 620 *its_id = its->identifiers[idx]; 621 return 0; 622 } regards, dan carpenter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel