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 82572A034F for ; Thu, 1 Apr 2021 10:48:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BF771410B0; Thu, 1 Apr 2021 10:48:28 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id F34CB40142; Thu, 1 Apr 2021 10:48:25 +0200 (CEST) IronPort-SDR: dic/rLzBgzeYsoOZ3lA+vk51idKGy44rIOsXZpoSU3xsiUwpFWFNsFj7nXPkRaMrWZJ8/HKWpZ 7WPi3vhDbVRg== X-IronPort-AV: E=McAfee;i="6000,8403,9940"; a="189957612" X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="189957612" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2021 01:48:15 -0700 IronPort-SDR: J7WC+gFEZ+IxjXWAokgiEtSEyXzHydrg/eb+jNpKdFQhdlb57wO2htFLik33eUowRbtTf5FNrd ZpZAzfwann6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="384772435" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga007.fm.intel.com with ESMTP; 01 Apr 2021 01:48:15 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx604.amr.corp.intel.com (10.18.126.84) 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 01:48:14 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) 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 01:48:14 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) by edgegateway.intel.com (192.55.55.68) 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 01:48:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IEa9OD871RwxwhxfMQ4FhTIoQxBaF4qEWXjNYkjvmLl4i8Q0VQGfg8wY/GuS69ajHuV44ykg/Su+Q4wVhm/wqjmAW4P6x/6VMP/B9iGulASe88n2LbUOzzi4EBM6I69Xf08/1cRHbz5NwOIy6iffbI/HyIDWsS6Uw8rPsb7qjGXOAfYX/usoJVfRV/G8w87YeWzdHi/6ACBbdhkaKVZ5194wRo5evCmZcSj7IbyyB0sElmqbnzhU7zfKBOliUefBDyVo+9rv+n3NTYBYKcWnX5XEM2rT4AnEWgw8Wyc+faduZA/j/g5m80qft7N7ZvHUgxx774Gnavqu1upXIKarxA== 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=30ETSAezUa+MN8IwVEasBh9xle66UYJytUUW8ihMQEc=; b=fksZjoNixYjWqFAgIinacnFGauGGpo8KpaCM1aKTVq9JC0oZ3IAi3kSWOya9H90YP7otr55ycZyCAxIsRQ2JZmfUotOry4AEpIGV3r9nKu9k5vxRE7JHd0ZjoZDCZl98+2qLphGqiYZcI6rO3UCbRMXDnALm4+WhrrL3hKBt5JUdbp4zGiOa1HJa+xRKIvO7C04mDlKThzQvspENAZqbUo2fAYS+GozMg9wom1ZZ7aLQvQNKfCYCxlSRh4evLPOmEUJqnk0zhVFLrOuNuUNFrWlGAmwCl540V3Z9nvpEfxANPGX6985V+F3QRoN3HOwQptATIWnX48Vs45ItSoxlPw== 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=30ETSAezUa+MN8IwVEasBh9xle66UYJytUUW8ihMQEc=; b=fEh+iObPxOXTqY3RtJirUvgirhWOxdOChxRLnTluwHtEwT6+XIoi6x+1BMkFR8ROCUSEkhA3HJjjr4ACB5xPu7w3nJaIdZJtoEw7XucuARNdm31+OMD15BfS7H7hFOFv0wIFeHURyVeB3Xfm4fsgoSP98TT/46YG/yV4H5/oXYA= Received: from BYAPR11MB2901.namprd11.prod.outlook.com (2603:10b6:a03:91::23) by BY5PR11MB4305.namprd11.prod.outlook.com (2603:10b6:a03:1bf::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Thu, 1 Apr 2021 08:48:12 +0000 Received: from BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::4447:5f1e:984e:57f3]) by BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::4447:5f1e:984e:57f3%3]) with mapi id 15.20.3999.028; Thu, 1 Apr 2021 08:48:12 +0000 From: "Xu, Rosen" To: "Huang, Wei" , "dev@dpdk.org" , "Zhang, Qi Z" CC: "stable@dpdk.org" , "Zhang, Tianfei" Thread-Topic: [PATCH v1 4/4] raw/ifpga/base: check pointer before dereferencing Thread-Index: AQHXGwaOEYK/6TiwCkWWZ/mh5tUQ5aqfcWgg Date: Thu, 1 Apr 2021 08:48:12 +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: 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.102.204.51] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6e3e899d-4b7d-43ee-40a6-08d8f4eae227 x-ms-traffictypediagnostic: BY5PR11MB4305: 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: Ov6gWiFcdHsGFo3E7MyaG6dGcgVYMbA0BXGNMLLRRNWQvPkIY6iGQN+gkfizIEaN0N/RYR/P7+4OzqiclGU6MJdAKw5+toDPDkXDAtfjHHHw1q1lKlXxjZ+MFTJa68R5Z7ss7nemoABkO2h0+8rPeiU1q6Q8hySajTfIpj9ourIzM8UNUU32pT4cnQz/O/z+tvxvgCHKeVGRE/C/v8ODofwPfVAuHo6RACl0CzPz0GGb3XkFjqV/lGV7FGAtusxwnIad7/ibNvcXcbdAR8w24T7LtEaoPIWTHjlqy96w1mMSbEYJugs0g95FUHZ3q47PoAMOyUrJ/IcHcFxcnTwTvNiimtAQztfXWwL7bmo44OthfIPUKNfxJRExZRJj4D9XP7ds6mlhL9JUD6KgACR8uEBV6rAOg8pZbDbub2jEPmJCIprZBEqg8ZgNNBzFk4uaSbKY7tFmuuZEimxme4AhtPfQVHB0rJTe+TlS9wScmsQn/dr/ih8xOdzDkOOJmgVTRUnr23kuvT7RpdlAd+WUPRdLJQYaiU70Wow6lEHRKAH6pdc7if0jaSMK3tUP6NehSQv1StdHd/dvJmUY7D7BuZZtWIgY8DPqNxv8oovRbauItJNTzxgpH3LdnCUBQQpx6GfwW1AOLi3i77qYXwCwQjtic0GVrnS2qa/OADROMM4= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2901.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(136003)(346002)(39860400002)(366004)(396003)(38100700001)(8676002)(55016002)(9686003)(71200400001)(54906003)(110136005)(8936002)(478600001)(4326008)(53546011)(107886003)(450100002)(6506007)(7696005)(5660300002)(186003)(2906002)(26005)(76116006)(316002)(64756008)(66476007)(52536014)(66556008)(66946007)(66446008)(33656002)(83380400001)(6636002)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?sBw0jnB77XcTJx7zCx8YLxc5NowEqDDLwAQZjJBHLIdQtdf8I9h1sgWcfEJL?= =?us-ascii?Q?tmlcM8/TvVsHfmMaCcltUVuYEfOx25JeS4fC9cazSzQu+2XkR7ZXQHTGj/lU?= =?us-ascii?Q?fZAXFJ3ERFlsRNJgNYvcE7sDj0tKwfSwNrX7HdX1h/bXhd4tlt2kA3zAaIqC?= =?us-ascii?Q?YgUZU0jdjZpm/h0viIvrpQY+w3nIh8Mf2pJtVZzML50GfxlBGgtvlFFrrFkb?= =?us-ascii?Q?wWfZXk8NM6SwCsBmJmYQOK6et8lcOH1mzwm4WkylieRytNvV+YsMtwxgpx0e?= =?us-ascii?Q?koz0U6hGTm20Ti8kIyWkUuYaaB5Z7MNkaEbVHT0yay934d6XWc+TQnNzQZaz?= =?us-ascii?Q?40nbWCKiIP3ctB6nyL7LN8IGjZ1zFClW6bXcIAJKww1KyqWwm5nq3MOFgtBM?= =?us-ascii?Q?r9hAX2LlhmUEIUQ4uvz9li+5dpRmUYS1lukGN7VVZC2CY4xjU8yGCMGcUCTk?= =?us-ascii?Q?HbRM06MvislLEPrpyo4eo9TqhYc1hG1bVVXFT8+A9N+pLPRVF2xolnJt4S9v?= =?us-ascii?Q?OD2f0bxHODI3Os9Lw+iKQ36zs2cUW7Bgf4FdiCP1pLKgFuhOQ/qwob/n7oFK?= =?us-ascii?Q?jdPQDIhdorKfHy1HPvWQxRg2Okd8l03AZ5YmT4zFUSPl0ctrGINtEPXLjFJ5?= =?us-ascii?Q?6G36tnYVaruN4zrJ9+zSrRiR5k32JiKx2EaKZC5ofZrSlxj79nLzCFor7/D+?= =?us-ascii?Q?JL9i0eX4V2jBScY95kERHffCBnL1S5QaSVZ1bvN11DHoFBe6xSg3rAtIoh/5?= =?us-ascii?Q?tCBSidldu95Fj9WisVsRYq/aTVopeUqjf9wSjXU8QRMxT5HtyXn6hdseQOqS?= =?us-ascii?Q?CCeCCkLfDzXMSHiUyBTAE9/Vpj1QsyPVw400wsyaiqY7gh/92zx9wLMbixO9?= =?us-ascii?Q?1infhhhEvFn22Hd97JJVbviiS0GWy2W8LAVY7Rkfr7cQfezMkUaXvB7dMBNR?= =?us-ascii?Q?4SKlZT8GGvlQqajfbUqMx5D3DxWSeGLbMoGFO9QcVYupIBOukoZHXSt8/E2B?= =?us-ascii?Q?vQ4NPn90PDNvzIP0E3fDz6lne/mHy+jPHpsgLtVpV7mxSyEjBhaKmmOdDjcw?= =?us-ascii?Q?sK7LpT+QrfRzKiq8tG+5ZXilJm9wTLTJSS5fTpF2V4Y8LicLUhwvi0igYJvA?= =?us-ascii?Q?r56d47A+95S/9wQM3YerC76yUvSMoy6nKek01tcEH9mMPvQqFUNv9ZzBIuSi?= =?us-ascii?Q?IzB7mvhtbAVkcsiVwGNfXQ/B/+1ZisBqFNkbdOKG3KFT5hfGIRVnRzXAtutA?= =?us-ascii?Q?drR3ddE/zmh2+w4wkYFuj/gSOkrtx3ANIX3ME1MuTgumGsxDjLiupD8ksXzt?= =?us-ascii?Q?7T+tI914vN30YjyL8405NUZO?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB2901.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e3e899d-4b7d-43ee-40a6-08d8f4eae227 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2021 08:48:12.5953 (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: N+Gef3ztOMQnAG+tAGmg7dIzaRzhvsxOwRklI0RwIPoZkHicBrn+PjCdXLO3H2nBgFL8H3Y1j7UtjsHlsmDF4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4305 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" Hi, -----Original Message----- From: Huang, Wei =20 Sent: Wednesday, March 17, 2021 4:22 PM To: dev@dpdk.org; Xu, Rosen ; Zhang, Qi Z Cc: stable@dpdk.org; Zhang, Tianfei ; Huang, Wei <= wei.huang@intel.com> Subject: [PATCH v1 4/4] raw/ifpga/base: check pointer before dereferencing In init_sec_mgr(), pointer "hw" may be NULL, so "hw" should be checked befo= re dereferencing. Coverity issue: 367483 Fixes: 7a4f3993f269 ("raw/ifpga: add FPGA RSU APIs") Signed-off-by: Wei Huang --- drivers/raw/ifpga/base/ifpga_sec_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/raw/ifpga/base/ifpga_sec_mgr.c b/drivers/raw/ifpga/bas= e/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; -- 2.29.2 Acked-by: Rosen Xu