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 BA005A0545; Thu, 23 Jun 2022 04:45:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60BCC4069D; Thu, 23 Jun 2022 04:45:04 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id E795C4069C for ; Thu, 23 Jun 2022 04:45:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655952303; x=1687488303; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Al/+MwSdUJGUG+R+YbujKhuZps7wCP6oYslZppW70T8=; b=V9pSeYd70csPfOHbBYnLQqz0ccaJMy4n+wN2jeP6rFBJdVkLWH+dWc/p TKxtGHmuR6vW3PpdOxm4ubMO2ZHcBz0E8aHTC8P6uzutEEkBLwjRWiy2R B5GExnnRrGjNAvMRgcmJ5CCqcEzfGvNqo5eDq81wSzauFdb2W/4XJgmwC viXoH105hKx4ekbvxQ22QxnEy8ITbwx+tSTtq3MiVYcJlX4xxMNRvFyrS 4Z/eoMfk+hgASU750PPVYXCNqqMSWyvuPgEyzzqBZHaR23OV/w6tvL5tj EXBqHH3NCpe/sQXDZvT0JD95T2jSDozgOrZaEB/mDvxKkjlEH8yK8/Am5 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="260423566" X-IronPort-AV: E=Sophos;i="5.92,215,1650956400"; d="scan'208";a="260423566" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 19:45:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,215,1650956400"; d="scan'208";a="715655536" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga004.jf.intel.com with ESMTP; 22 Jun 2022 19:45:01 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 22 Jun 2022 19:45:01 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 22 Jun 2022 19:45:00 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 22 Jun 2022 19:45:00 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 22 Jun 2022 19:45:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pk7h5J/XRYR1CltYqTeeapFT5N7xsd6at/cqPBapzz+cWXXhrsJzGiq15PlRl4IxULimd5yw/dBTWM9DC7SoPW07y1c7mWw9iaSr6rPhhZY90Ps1d0EEBb8rojVnct+S6+RX3ZpaMHDyS9z0/rFkMT+JNRHVgd2M6Gv1yAW82ZDFNXGIp93yeQN0cYjma6lWtrArmeYnXWx07BkPIYU7rkOyfyXH/NmtOaHSX+7WKngdb6Iy2EBF+CMwqFZO29WYphRsSWT2J3wCQsxURcXMCIcJtB5LP2FRs0pIwNYBkvNFWbDrI7soZ/H0H+m9uVlzt2kh6TUC10ekZY+dvHLXeQ== 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=i3ZQiod8Daltbx6A8uFrAPSSZ9COvrcTKXGUFG7RxP8=; b=nNPIMUluCiR6v9LoiDytTf/HuuUClpkViB/Ge3v7Qv/b2XAQa6SsbF6827SvMj5GgUTWs0dz3cqKXuPTXac/Fu5EtwO3irx0Bxz53C4liMMdqSmqyuWanOm85iJjpA/72W6/4AVNq6C7cVSbixKEg9pcCv3oKwMYvXZbl6ar3k4M6/QMgj22LVTdlpS2sR/rsbc0gL+Hc5jY+D55o+mkpYvJZmBrCl5lfsvFwW+39CERdtt+ufa1+WcwBDnbmXLtYLV56yaen92HPYyhTLF+1yT0UAi7mSZFlRjnu+hi/SbnqzY1O5MWo3cqoJ7lPLAc9mSQUfSNeTi/12qvpP62Fw== 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 Received: from SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by BN6PR11MB1379.namprd11.prod.outlook.com (2603:10b6:404:48::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14; Thu, 23 Jun 2022 02:44:58 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54a0:2dbc:18b7:2aa9]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54a0:2dbc:18b7:2aa9%7]) with mapi id 15.20.5353.022; Thu, 23 Jun 2022 02:44:58 +0000 From: "Xia, Chenbo" To: "Hu, Jiayu" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" Subject: RE: [PATCH] vhost: fix unchecked return value Thread-Topic: [PATCH] vhost: fix unchecked return value Thread-Index: AQHYhp3dW5Ydt8EyZECuXJgRlG+TT61cSPeA Date: Thu, 23 Jun 2022 02:44:58 +0000 Message-ID: References: <20220623010858.951367-1-jiayu.hu@intel.com> In-Reply-To: <20220623010858.951367-1-jiayu.hu@intel.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 26d0a4b0-063c-469a-2320-08da54c25cc3 x-ms-traffictypediagnostic: BN6PR11MB1379:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: h6BxzyrJ4WgWFtc0o76UnvzAK0yWXVKTFYuwnJzNiiN/+tP9XilNIwgN11RR3+ud+J1NvwzPHE2XWul6KXYg1QVn/pNrZDKDIDxQMipfMlk/ackBRvLnozgo76YjN7BgVFRQh010jedT5rBEzXW2dptUHm5+T2mAVlwsY5DykSYQKNecYIrBDwoV5abeSrhxILztMYvczQnCNtVcglq/Iizb3TioOFLKMNo/027fN8v1WRcBSXbvnXYI1FarILVV9UcD0wmu/1X/GfxtYVwGvJDtMkk3FMbKKXkXJzPbUOhDsvqXyv/elIYm2Mx1kx4LvChtLtKkd5WV5ZfoiIP7DzY4RwaYUFbkY3ltqBhCiIixEALcwSGtjeki3aZTE691U1FW5HCtjk+b3zYtMS/C5lBnYHu1Tu9NWvaFIJ345iiHIbSdmLCu2l+0o39DsDHFZyk7t36qUWVhY/yoo731bBA+pkLvdZrhFqbpjepc9MYcYW5trc6Bvq8RYiQwtzqI3hyqGM9n8wm/xaprwbqSRLIt3GVciogDzU5YDqBleOjP1s97ibteayvsOkZOcOD+KhiCSBtw5FQbhNK8nfkyHYygPKkAKEudsaVZ1eJU9CPDIW+KP7Sxadl0ewIaHll02+W7d0dfYpWH4E63m+gQC6BjD/hBJaqbnBpKaEzpxHTSvGxXsDihOTCrN8U+S31Zoz2bJhdrbFAUuEJvBuNHWy7Y5JKp/16eIn8NajB1bgP0HBvBuMXfzASWFVBS3Bt7rlQMn0V3cW0khCk/HtJrxw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(396003)(366004)(136003)(346002)(376002)(9686003)(122000001)(186003)(86362001)(41300700001)(6506007)(82960400001)(38100700002)(316002)(83380400001)(26005)(7696005)(71200400001)(53546011)(38070700005)(64756008)(52536014)(8676002)(4326008)(2906002)(5660300002)(66476007)(55016003)(478600001)(76116006)(110136005)(66556008)(66946007)(8936002)(33656002)(66446008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?l91tBkJHFp+ZFtz5iImMSAjJpn9rlh+extJFmxksXxsRXHvgrWWcuAXWvS7B?= =?us-ascii?Q?6JYBAd1LnKpqGB02M4t8sAsiK7qvpDD15Qf5BbMZQu6bzsHOhNnTieRh5GFd?= =?us-ascii?Q?QRjcgqjOfi7wZgANWTng01sNjDYwVJt1dCq6BtDRV3xMTe0asheYXNnLtkTF?= =?us-ascii?Q?Rws3xCVzYXR9wJBtyQWumQSoHMmw1lTFXJK5ma36+XLAl/gGvMrshCJPetIj?= =?us-ascii?Q?r5ZtAmpq03FpWxw2i+M6y3qCtnyClIh724dtvSLB6Md8fnEaNqubYi9zOCLI?= =?us-ascii?Q?bTwXM87FgOfyjFAIfhD9fRFj6Y4KcB7GSWC+ouVFHe9QKR2hTJlHzrIjnD36?= =?us-ascii?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/mOgO3OGX3ZM6E06?= =?us-ascii?Q?N4iIQcrWDNdWkXgqP1MMW1AcDSXATXKWsYbAGDx5LENrgVawfD+Q6KtdjL5z?= =?us-ascii?Q?XYLvJVzdgQCBbTfGz4FTUItORF7n8lvQUXeXtUPaRIq9duRDUvJN4wDTflbm?= =?us-ascii?Q?C5AGgBU83CW5L0X8UyjcSvsehAN2gqeIMD97sYINWeOASkKoOeMmWwO8CHQz?= =?us-ascii?Q?IXYZuq0x+wHfua8IF2audJDnTNTuvYecouOzYq7hVXKAh6Z8nQXIRZX2F8wE?= =?us-ascii?Q?3ck+I8D/hfu7v0+P0pdJnY56k8hUCIgXYyVzyCu5mu5qTLaDfBR2UL4NRmgm?= =?us-ascii?Q?LdJ5dQU/rEXKYn6RJ3sDlxAf0qzrN0UiQINuCIg5K/GuqdossTXCjoVXVaDN?= =?us-ascii?Q?0m3DqXW9GoyQXRypISZyv9Nzb15NRXhyamfCSKSvzxqje5JmwizV7igHnpT5?= =?us-ascii?Q?y+sqRyIGRlVClt/AXVWI0kQqdU1zAyPUZzDbWh2SlR5gGd7/PlJXZnfoKYna?= =?us-ascii?Q?EEy1/otE/A=3D=3D?= 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: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26d0a4b0-063c-469a-2320-08da54c25cc3 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2022 02:44:58.2402 (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: KM4W1Ho+Cz03jxdi5vwbxP15peHk1AmOX0rKwOWcmNOe5U9OIlcm5TBUA26L/SsEJNVI+ZC4PoezmFGXkK9BwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1379 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Jiayu, > -----Original Message----- > From: Hu, Jiayu > Sent: Thursday, June 23, 2022 9:09 AM > To: dev@dpdk.org > Cc: maxime.coquelin@redhat.com; Xia, Chenbo ; Hu, > Jiayu > Subject: [PATCH] vhost: fix unchecked return value >=20 > This patch checks the return value of rte_dma_info_get() > called in rte_vhost_async_dma_configure(). >=20 > Coverity issue: 379066 > Fixes: 53d3f4778c1d ("vhost: integrate dmadev in asynchronous data-path") Missed CC stable tag With this fixed: Reviewed-by: Chenbo Xia >=20 > Signed-off-by: Jiayu Hu > --- > lib/vhost/vhost.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c > index b14521e4d1..70c04c036e 100644 > --- a/lib/vhost/vhost.c > +++ b/lib/vhost/vhost.c > @@ -1868,7 +1868,11 @@ rte_vhost_async_dma_configure(int16_t dma_id, > uint16_t vchan_id) > return -1; > } >=20 > - rte_dma_info_get(dma_id, &info); > + if (rte_dma_info_get(dma_id, &info) !=3D 0) { > + VHOST_LOG_CONFIG(ERR, "Fail to get DMA %d information.\n", > dma_id); > + return -1; > + } > + > if (vchan_id >=3D info.max_vchans) { > VHOST_LOG_CONFIG(ERR, "Invalid DMA %d vChannel %u.\n", dma_id, > vchan_id); > return -1; > -- > 2.25.1