From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 127BBA0547 for ; Thu, 1 Apr 2021 09:47:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09380141096; Thu, 1 Apr 2021 09:47:35 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id CEAEB40142; Thu, 1 Apr 2021 09:47:31 +0200 (CEST) IronPort-SDR: PCG1fL5It+5eRdjkCWwM+d0lAOnmeH2tiYpvJtviYyHBHOGzegUgm40Ho8q6Mzxi4JSEHej1OW lxaKIzfJdolw== X-IronPort-AV: E=McAfee;i="6000,8403,9940"; a="179304865" X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="179304865" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2021 00:47:30 -0700 IronPort-SDR: yY6ubiofB/oaoXQ5vBr8YfmQng6JDBmKpcDp2P+3xWVSrfUo/wsv5f7GbqfYYCO2BKp9RxHiU5 +2/8byzlNBnQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="379208753" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga006.jf.intel.com with ESMTP; 01 Apr 2021 00:47:28 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 1 Apr 2021 00:47:27 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Thu, 1 Apr 2021 00:47:26 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Thu, 1 Apr 2021 00:47:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oOrUkrZUjTZlwk1+6GLZ4Ei/ftXew27kxIJQlAVhfMpvJ2HeNCF8xzqA+rw15w34iPtXHXdASf8UlT0wO4+yv46+E9h1AxOSK3nN8ceL837nMrEwsN2vi6AncP9ZpaQKiZLQ7Cq1HZz+9IOTe1wGiD2qtjRIlMazCx2JHSz+6wiF3wvf0tqUXKzZpTbgbfZaC6Y7tPYzi6xWiwEi8NiufcWWNHgzGWxVMI3EyaX6zYcMv3RlRlr9NEVAdAR6i3Cjc8lo9B+n636Ce5ya+GOq8pSdjpn4LgFImKUJS2GskRWt1rZliqBa3CXNMSEX07lSh/uTSFst9mj8GdDJAv2ujw== 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-SenderADCheck; bh=TRkVQHdctOYZOS/bLOtQ9sgAbpR5S2SijEFi9nO5jRc=; b=PDebW8k+Pje1is7qi6taDwSI7Uf5ws0QLDxCnZVor5iHe4AJc+JqqMeai+Jzgjp2xoJUazmTTYJusMiWR5ev7EszfkpK0dIJLOAy62OsFL50Z+thgAj6gkoHVbh73a+r90/J0qZ6N18Xc1y7AUv0HeOFkMUm+G6I7dEaZ5mrXmy3XXvhOdw7lOX5HxlgFwMr6/xB2FFE8U1Jhi8H+JknVH8i2Hg3Ad0gymERlZ/fSFFOUqIDo6TZM9Gyj1dSQaTc43zOsZLQigURb95024GexMs/ZYTawucKgSShGl3TTXTwQ4BZAcrUPcp/7ujffCq7PrW4JXfHYfl6KGqHuKijEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TRkVQHdctOYZOS/bLOtQ9sgAbpR5S2SijEFi9nO5jRc=; b=XL4GQsji/Btwe4XUztjM3aXrDu/lt7YEZI2xOPaxacRo5pSU9Ujz9V+n1JbsZGR+UznZx6H+cybLEZ1y40BiLmJLHeP4eHAxFfplv2BeV53WEh9oOPtKQOt1PBUN805mkFVNSiVRp7NLQpmFwUhqsjhY6XWBgf9oTcX//emyWWw= Received: from DM6PR11MB3131.namprd11.prod.outlook.com (2603:10b6:5:6d::32) by DM6PR11MB3468.namprd11.prod.outlook.com (2603:10b6:5:5c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.29; Thu, 1 Apr 2021 07:47:24 +0000 Received: from DM6PR11MB3131.namprd11.prod.outlook.com ([fe80::181b:59f1:8b7e:b9db]) by DM6PR11MB3131.namprd11.prod.outlook.com ([fe80::181b:59f1:8b7e:b9db%6]) with mapi id 15.20.3999.028; Thu, 1 Apr 2021 07:47:24 +0000 From: "Zhang, Tianfei" To: "Huang, Wei" , "dev@dpdk.org" , "Xu, Rosen" , "Zhang, Qi Z" CC: "stable@dpdk.org" Thread-Topic: [PATCH v1 4/4] raw/ifpga/base: check pointer before dereferencing Thread-Index: AQHXGwaO027R7aJFQ06+VQMAdYRej6qfYGog Date: Thu, 1 Apr 2021 07:47:24 +0000 Message-ID: References: <1615969296-17021-1-git-send-email-wei.huang@intel.com> <1615969296-17021-5-git-send-email-wei.huang@intel.com> In-Reply-To: <1615969296-17021-5-git-send-email-wei.huang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.5.1.3 dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a6c0dcd8-a028-475f-40dd-08d8f4e263d0 x-ms-traffictypediagnostic: DM6PR11MB3468: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:415; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: knsrL9gr+AO8mFjbT2jzKD6GhCiUeX0rMBLOXzoBw/Umk7IDMFGS8UJ/iyZpk/0rnQHQXRZ4UU3qDzvTE0eab+BSrq7ZZKzc6UElyEfdDEsT/bZVB0rCzXxgx67i/rx39ZLCFrfD/pTSrhlRYBxuMUwgM+yUhNmbHSFY3tG7E/3vHUfJjJkpEoRfdtjbOfu/bY2EIVEuF3WW8IOxcUFteYZYS6j+KK175zvyS4nBnPS1bTK7l6Et4J3tJaPfOE+u9f/XhdgpW7seF39mtJeYhTXHMueAuryWzN+j8/lpGMua1yusJkcAZyu78BIygWqP4iuG2PQZJkhvAWCsTln+RsAnGWQlGWHFfA46ZTBXiLwGXLfdneFM1QigKpm6zgw8EATExK+vOn0Y9fMbCCqIHp/86wnwhYcfJylX9ogaqIt2rsnGPgEVRBuz4c2T7XrORqS6PwGQ88r2B11iLvWH+O+blwtEJeKHA7wPPRQ4XQUilxxCCF2+yNW/vcjX2F7ch0pU5iGR/hzrS7/nKcfi2CsKqrCCxLc6OdYfacSnUn+Lyrj/PlDfcHu/ScNcnUYilRcNh00W1PBxjPEetUr9e5LyikfnJGpMW3Z3uBaR5oqRjwbs01luSzYsMncXjKuyLO8IJOnoArgyqGnSE58pCqLmaO/L1/L1InZn8gomWXQ= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3131.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(396003)(136003)(366004)(346002)(39860400002)(66446008)(33656002)(7696005)(66946007)(66476007)(2906002)(53546011)(38100700001)(26005)(316002)(55016002)(9686003)(186003)(76116006)(71200400001)(110136005)(86362001)(5660300002)(4326008)(450100002)(8676002)(6636002)(52536014)(64756008)(83380400001)(8936002)(6506007)(478600001)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?iso-2022-jp?B?VURhTU5NYW1BeWg4eDVhMmFvZ2plMHZ5S2ZwYWJYTzNybkxTZER5YjFC?= =?iso-2022-jp?B?VUY0MmtRVjlZOHhqQU02cGpVQlUzdURibnlzQTRCV1NqM3d4ajZGSWpm?= =?iso-2022-jp?B?ckhtOEttRjlaelJHTGlwTTgySWwzTUtMSnNyNlcrR3E1L2l3NXdFU3NU?= =?iso-2022-jp?B?dytEUjdSOXBGVEt0NmJYV0ZpMWtIMG5IUnhHdW9Fa0Q3VDNnaHk4YUp1?= =?iso-2022-jp?B?LzdEcUsySmwrSFFrU1V4Uy8ySDRMa1IycUNsNTREUjcyREs3ZElkc1h5?= =?iso-2022-jp?B?cUJneXgya1FKL0tTMlBEQU5UZDdPd2crT3pFMTFoNUpEelJyWGNNRzQ1?= =?iso-2022-jp?B?L1Qzd0pBemJiUE9zM005WFZmKzhRTTVtTXZmYmIyT1p1d3hGSW1BNE1X?= =?iso-2022-jp?B?NFZ0RElJNUZBcy9HV3VXbEdvRFI0RDU1eTRGdjRkem55UW40d0RLbUs3?= =?iso-2022-jp?B?VHZ2V3NBR0poNFBxVFhKeTRNY3hzd1BEa2ZWKzZ2dEhxbHhnelowUGNx?= =?iso-2022-jp?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VpTHdQ?= =?iso-2022-jp?B?eDFWZ29CVjQ3amJRL24za1RlU1UwcUtHMFkvK0xnemtkaEhsa1ZiRXVx?= =?iso-2022-jp?B?NXF4cE5ZR3pqaFZZQ3c5WnVwSVBtdXUxbjhUbHhOVXBoZENBVzV6eTMw?= =?iso-2022-jp?B?QXpqeG5HOWxHWFg5VzZydWtxWENsbzlyVzNBMFJEUW92NmJOL09wSGdh?= =?iso-2022-jp?B?RElrWmJ1aDBNSGNDQVlNYWdtQkRZQ0RnNk1nTm1QYTJQZ21hSGJ5eHdR?= =?iso-2022-jp?B?Nnc5OUlyTVcxMXN5WEYrdCtFL3VlN1pySTlkSzVFNmRMb2tDLzM1NWl3?= =?iso-2022-jp?B?bllMNkxOb21vaEx0eVo3MjRUWUJQSkpYYlk1cTJjU25JWCtSZUpWdkdI?= =?iso-2022-jp?B?aUp6N2xBQXV0Ym9pWVI0T2o2MlVuN1ZLbE9WVytyTEtHQzc5VlFlT1VM?= =?iso-2022-jp?B?RENjNWNJd09SdzRWbEt5WWJUU1gzZHdXNGJLV0JOQXZEdW91RUk5bHBn?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3131.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6c0dcd8-a028-475f-40dd-08d8f4e263d0 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2021 07:47:24.6004 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VX5LVsUBajHK8t/y99xuTddiwCNcOASLwbi+LsIxSyy96hat728xCLcCWg674iKS88mtppYdN+otPWxr/iqxRg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3468 X-OriginatorOrg: intel.com Subject: Re: [dpdk-stable] [PATCH v1 4/4] raw/ifpga/base: check pointer before dereferencing X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > -----Original Message----- > From: Huang, Wei > Sent: 2021=1B$BG/=1B(B3=1B$B7n=1B(B17=1B$BF|=1B(B 16:22 > To: dev@dpdk.org; Xu, Rosen ; Zhang, Qi Z > > Cc: stable@dpdk.org; Zhang, Tianfei ; Huang, Wei > > Subject: [PATCH v1 4/4] raw/ifpga/base: check pointer before dereferencin= g >=20 > In init_sec_mgr(), pointer "hw" may be NULL, so "hw" should be checked > before dereferencing. >=20 > Coverity issue: 367483 > Fixes: 7a4f3993f269 ("raw/ifpga: add FPGA RSU APIs") >=20 > Signed-off-by: Wei Huang > --- > drivers/raw/ifpga/base/ifpga_sec_mgr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/raw/ifpga/base/ifpga_sec_mgr.c > b/drivers/raw/ifpga/base/ifpga_sec_mgr.c > index 4cf1db3049..15fb5b6d4d 100644 > --- a/drivers/raw/ifpga/base/ifpga_sec_mgr.c > +++ b/drivers/raw/ifpga/base/ifpga_sec_mgr.c > @@ -610,7 +610,7 @@ int init_sec_mgr(struct ifpga_fme_hw *fme) > smgr->rsu_status =3D NULL; > } >=20 > - if ((hw->pci_data->device_id =3D=3D IFPGA_N3000_DID) && > + if (hw && (hw->pci_data->device_id =3D=3D IFPGA_N3000_DID) && > (hw->pci_data->vendor_id =3D=3D IFPGA_N3000_VID)) { > smgr->ops =3D &n3000_sec_ops; > smgr->copy_speed =3D IFPGA_N3000_COPY_SPEED; > -- Acked-by: Tianfei zhang