Message ID | 1636034145-7962-2-git-send-email-mike.marciniszyn@cornelisnetworks.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <linux-rdma-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 711F4C4332F for <linux-rdma@archiver.kernel.org>; Thu, 4 Nov 2021 13:56:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5929861139 for <linux-rdma@archiver.kernel.org>; Thu, 4 Nov 2021 13:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbhKDN6m (ORCPT <rfc822;linux-rdma@archiver.kernel.org>); Thu, 4 Nov 2021 09:58:42 -0400 Received: from mail-dm6nam11on2127.outbound.protection.outlook.com ([40.107.223.127]:37057 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231166AbhKDN6k (ORCPT <rfc822;linux-rdma@vger.kernel.org>); Thu, 4 Nov 2021 09:58:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kulYD6vk/yVEq8ViRibkntqGoixmf7T+cFjMuwsQrEqy5iWlFnqQhDIn2SZCuymOVE13KIm8WIc+2iReEcRCJD1F8U4dNNq3wVkJe0Axgm8s+N3prBgYMf4UoAN06LF1Ks6IFZRtVyvq64ejVdb1/WtA3pv+dGhTcIV4UkozajiryoQQ+ksaQMhmmFXEoeMl+wvkDrRLv7OXh/oCCJ2VSW1oDL8dQmS/uQ7mfteMGClMZ9w/LOtaNq3IDIDgS/SrYviABWTihhmsbX1PvgL5o+fueQgnhHZ5dPMRkYy6v20d1BygfAW1rBGDp8/X2kNw9JIiQXrkL2+y2mO/3Kgtng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LGpTztVlugx6+KA6bi6Z8df9tuP4Sd2/nFdiOxVi4oE=; b=Sbtg8DAOPKZgULaRcoaEnT8kyyu+Sl6hE8o28Rkh9SzK4Srp2zxxgxvmGXW9H0cSaZCPFr5SXib3IZ3my/iUF0tN5dDK6q0Jt9VFxhgi8hjeIs3YURnS8WZqmoFIOmihakLMQG3W8utsTBhsp1qCiz6+8F8O8JuCK9De8e4J9ONZVRMjcGNyInf38rho8hK1x/yF38llVXRVQYP4efjh165wsRLUGqMISpETXT4yAi1Zc31G1vbCZq4i6tN1Qyqys+SsGYxb2BokIIkyt6ByfHuMJEzun9uDGk85RGr9w1pKyUSeIpKrgBTISG/BdytxF9kBlN3PLg+uJGL2C9bZ8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LGpTztVlugx6+KA6bi6Z8df9tuP4Sd2/nFdiOxVi4oE=; b=WP7PxDSjn6JYDswZN0j1ssagkPplJwrJfUCzNWcIlz3aWuZQluMlsdjpstZGVaKJ5z08aJIzGWURM//oJwt1vNGsx2gPrXbuPUWJl/DqClkDhDwaeRS7MxMiT3Ft9QYGYh5ETr0rk895j73YMsGKU/hsyD0qfgvyNIDLCfDy3PyyRzDBzKdELzFshoJYC9BXI0fpWq7tlDiZHlIW4QJ4OnMdO4+wecmlaN6Vl+i7VfzQPiixFSd1FqWaXLc/zlx3Z/sZnf676Ufgcga8bftlactZVQ50LFWWrR1cgQD12wq4Kb4hVizoF5kmbB/+1Q606XGd682nmYtCSzEfoAbleA== Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cornelisnetworks.com; Received: from CH0PR01MB7153.prod.exchangelabs.com (2603:10b6:610:ea::7) by CH0PR01MB7107.prod.exchangelabs.com (2603:10b6:610:f1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Thu, 4 Nov 2021 13:56:00 +0000 Received: from CH0PR01MB7153.prod.exchangelabs.com ([fe80::bdea:4e22:1b89:24e0]) by CH0PR01MB7153.prod.exchangelabs.com ([fe80::bdea:4e22:1b89:24e0%7]) with mapi id 15.20.4649.019; Thu, 4 Nov 2021 13:56:00 +0000 From: mike.marciniszyn@cornelisnetworks.com To: stable@vger.kernel.org Cc: linux-rdma@vger.kernel.org, "Gustavo A. R. Silva" <gustavo@embeddedor.com>, Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>, Jason Gunthorpe <jgg@mellanox.com> Subject: [PATCH 4.14-stable 1/2] IB/qib: Use struct_size() helper Date: Thu, 4 Nov 2021 09:55:44 -0400 Message-Id: <1636034145-7962-2-git-send-email-mike.marciniszyn@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1636034145-7962-1-git-send-email-mike.marciniszyn@cornelisnetworks.com> References: <1636034145-7962-1-git-send-email-mike.marciniszyn@cornelisnetworks.com> Content-Type: text/plain X-ClientProxiedBy: MN2PR14CA0019.namprd14.prod.outlook.com (2603:10b6:208:23e::24) To CH0PR01MB7153.prod.exchangelabs.com (2603:10b6:610:ea::7) MIME-Version: 1.0 Received: from awfm-01.cornelisnetworks.com (208.255.156.42) by MN2PR14CA0019.namprd14.prod.outlook.com (2603:10b6:208:23e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Thu, 4 Nov 2021 13:55:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 819abe76-2f1c-48fc-158b-08d99f9ad541 X-MS-TrafficTypeDiagnostic: CH0PR01MB7107: X-Microsoft-Antispam-PRVS: <CH0PR01MB710711A9776F0D201B49B867F28D9@CH0PR01MB7107.prod.exchangelabs.com> X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SDgj8GmHZpYbeBsSg0ZM34vB97aV6aEPXh6wfCS5EUlhL84uLty7203+zyLA1k7nuOwg9kf4dIfH2qPAqjftYDlGmbOcyB8QkGBToYLHco+nfkmnJ9EIlsKseFbRWdbymx159m2ZXOQwLObL2XdE7eccMiyJU1c6G52IEEJEs4fuCPPZtMa6Nyiit5qo4J7k729tv71o13JCXeWPeeHKU0ssWkaMLt9dQqu/Aqfi6Iemu1shL/6Mh6YfNFfar8gqO84LuhTcjI2gKzPCtXU5yROSRT8iRgnCKl97sVs16/7/khxyjehJ5Dak53rBgcUk0fSmAXEiD8AuZmqWDfIWWWm6NoX/Z/72Tv8cbsG1xy/ia/sQXMp7bb6H8a3k+/n8q05v37y9T0R/F96BSV95lKnO1b9c0vFPbjH6dDQEhDoUJMu5vmWofttRmnK7Eg++dWTq/2jV2ExYYIlRCnWOI2rSnl7oLNevslVuJMaXtq5WgrUz77f9L3KcxxXwnwM86b1w2mXFiBoiK5F1GjiBVd7QvDEIoo1FlLm/qHSHiaqxy64Xb9HLBK3ig/d7qqeN4d9vIGLfnoHn4vwyKhy4eVcPuv6YyaNLJwhCSUaTGikbjz9b8qpim9v8PJ4JhPHctVNtLmymKhDgqaYUY8Z54wv1NEBXhV24kOR4XbhxV4Zaoqx1DnrUYLSAV6nxuWOzLFPzKuphFaoryxEzRC+r9w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR01MB7153.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(366004)(346002)(39840400004)(396003)(2616005)(956004)(6486002)(66556008)(66476007)(83380400001)(9686003)(6916009)(508600001)(66946007)(316002)(36756003)(2906002)(86362001)(26005)(8936002)(38350700002)(8676002)(4326008)(38100700002)(7696005)(52116002)(186003)(5660300002)(6666004)(54906003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OhGYtzX3Zt5lc/ilOS1Ar96zIe95xIV9yVqrSLmPQMkBTzrkMO/VH7ZHUi0p7KBCjX5oZZmvdql3G7tgtA4rulS83hEB4wPqH/PAqiKCGluvlvHoTpYEbXmU40wPJWtIolobbb5RuCjZFLAT2UumoSutI5UA3jFJW3Uq2p/myggTOBQTOdUPU78kqVwS7Ifk+5TGKrTNNyV9KbJ2YIed5EDDwgTNd6xB+G2pvKZEcr9YxKlsJipe6pCnkYr8SrP8lGBGPxijJcOdK8saLpRzFbXkGHjI/AnucUXugglYnxvLjHwtWqNGJRBbJ2q6FOtRNdRv6lYQ+yC8/tDAmsMif7BzKwWFxtHT0asU50/0olcGzj1LxCL2e2/BjF/vQVcczb+0PNN7FBkDEe3SDU8VZMK6ivEaUuoy6Fl7ENWYLaVRYv9TJEQiDY0Lz21FR0LHGrmTeQuIRYDf2G9vBsDC7T+7z5yDG0EOwllvTwew4r+i0qt+JirCJCuUxm7Di2HzT/K9n0bS2OyUDgIx+GOqJksQNFRfMGOD3FWFIEdMostRJOrZtL7RZzy3zJ/KP4gjlZiDr4+8zhACNtIK8IQnxvwt71yQoZSlDHPQ+8TDSVtLChYHnCSjWF4C1899yQ3iYHWzIYLW/XM/u7I8CaU3tqkdfZJyPQ71v/cij3Zr99QQ3nDt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g: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 819abe76-2f1c-48fc-158b-08d99f9ad541 X-MS-Exchange-CrossTenant-AuthSource: CH0PR01MB7153.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2021 13:56:00.2990 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: srWP3Vd5FHn8mTT5wscWbg17Mpkvi6G63kriEiqH71qLGEbYxmS+41vKTxEzqxy0VhiD7jKaG3He5/6zXhyAPpvni538ztIB5Pzn+I7xiyg3002IUkdIsydQjR+QwHd5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR01MB7107 Precedence: bulk List-ID: <linux-rdma.vger.kernel.org> X-Mailing-List: linux-rdma@vger.kernel.org |
Series |
Port upstream patch
|
expand
|
diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c b/drivers/infiniband/hw/qib/qib_user_sdma.c index 926f3c8..ffb4257 100644 --- a/drivers/infiniband/hw/qib/qib_user_sdma.c +++ b/drivers/infiniband/hw/qib/qib_user_sdma.c @@ -41,6 +41,7 @@ #include <linux/rbtree.h> #include <linux/spinlock.h> #include <linux/delay.h> +#include <linux/overflow.h> #include "qib.h" #include "qib_user_sdma.h" @@ -908,10 +909,11 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd, } if (frag_size) { - int pktsize, tidsmsize, n; + int tidsmsize, n; + size_t pktsize; n = npages*((2*PAGE_SIZE/frag_size)+1); - pktsize = sizeof(*pkt) + sizeof(pkt->addr[0])*n; + pktsize = struct_size(pkt, addr, n); /* * Determine if this is tid-sdma or just sdma.