From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CF86EA0528; Fri, 17 Jul 2020 10:08:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 28B1F1BF46; Fri, 17 Jul 2020 10:08:42 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 19C9D2AA6 for ; Fri, 17 Jul 2020 10:08:39 +0200 (CEST) IronPort-SDR: DmDjUWmRa194NAViPm6KFNFh9z1+C0gLonCQIGgzLhZ/J2Q9SL/611w4ZU/ansuUITmnjyAkO/ +fv3fiSQ9+gw== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="129637659" X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="129637659" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 01:08:39 -0700 IronPort-SDR: QaEf1IHWlrxOVsN9SfZIuIrBLMDDzvbFFlcuUBfG/LPmpAw+mtpBQzZIZcRyW2f5NLwLOU//xq 4SzDrazCb3bA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="361282822" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga001.jf.intel.com with ESMTP; 17 Jul 2020 01:08:38 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 17 Jul 2020 01:08:38 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.170) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 17 Jul 2020 01:08:38 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L73gMDKoxAM9E7Q/1edFnv6Y1aX6gtTqf77qxSgNh5FprAQV8pt4ERFqzqSFgybfcWwgaqN6pGjEvBWX9QU8QyGUH+VXeB2UcIW4whDN8qKmivC3L9OokSPlL0wHsMUOZuJ0QmINRf32efgmtoPueissKNwzqyfo1FUlQbly/cleuty/5JxSKGcsgidXx3I/vEInVCV5id7L7VGqHP8t4rvlN33g6Ys0sT+3MWlPYe0AXOJCUzyiyvVdJJwljFyCQ2C9F9c7YuHQRviQrWDeq7GHIs1CieYh2vx/Z+z8qLttRxkuVlyagLmaAsQYlDGQmG0wFPpM6yo2op+cPd34vA== 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=yWPAVIXhdv3APny2iYD/UKhMNkF0PqD/EGUd8hrD6kE=; b=KR1QyRb/ql+U+tb9xmldSZMQSnqPYoUvBrM1Ww+lQ5YDy3UjGvGv1iPXnibxYzHLWpZWOnjVeoYxiauxzzvqWaC5ETjqTCfnXiVoGH0qGJDIH4KtsRs+1QG3wheJ+P6CeVR8/7VK5o15bE7x0cmt/v1m2AsatLZWT7Kwh+KA1h7vVs6EY7LdOCrOKPDdQH0JBKSd3dReVenDaTQL9ydqBEvTnIBYtArhn8RGRkgYkxU1FEzzGrv2Z7sdzxQIgIX9aeWO4wZWbEQ6vK6nT0yMNhnZFwqFLFulKpdN8Pm5bQ1mG7eAGLOnwyZtVe+Hr3hkSSMsJkHVvvOpAwr/Q/HP4Q== 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=yWPAVIXhdv3APny2iYD/UKhMNkF0PqD/EGUd8hrD6kE=; b=uhv5Wn+ESF5I+clyzJTE9X9Q+N6vvDUBYHonEfufT6tMcwnt2rtjduFM7s1b6YPZkw8IjfiMhwOfKer81/1qxikihp/aiB5CsiMMWhvi0JM3AnBLcfLFmYcy2jm3XFG9bRJPAkWj6qj0u4lTP8qObV4/dIzMxz9AUsdxWsB+a4Y= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB3934.namprd11.prod.outlook.com (2603:10b6:208:152::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Fri, 17 Jul 2020 08:08:37 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::7cde:8326:5010:c47e]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::7cde:8326:5010:c47e%7]) with mapi id 15.20.3174.025; Fri, 17 Jul 2020 08:08:37 +0000 From: "Xia, Chenbo" To: "Fu, Patrick" , "dev@dpdk.org" , "maxime.coquelin@redhat.com" Thread-Topic: [PATCH v2] vhost: fix missing null dev pointer check Thread-Index: AQHWW4dKGuxLbAW55UmyWjibpTreAqkLa5qg Date: Fri, 17 Jul 2020 08:08:36 +0000 Message-ID: References: <20200714060008.1991779-1-patrick.fu@intel.com> <20200716153758.2895041-1-patrick.fu@intel.com> In-Reply-To: <20200716153758.2895041-1-patrick.fu@intel.com> Accept-Language: en-US, zh-CN 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.198.147.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e5d64a2d-b3f3-4ba3-bad1-08d82a289baf x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:403; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9dq6olY3RiKu4Nbawy2tKx3VOJ4uuDzQWdfnJmHbU/dW+ufEJSzZUxyTowDTg9sranj4QkLW0eyzo4fQ3xBkFiIkSIzsLXpU8Rdl/kepeegHKepKTqBjdWoYLALQiG2ApaP4hZN0OrHmz5jx1jwszLy9zxUNYBi8thwRMhWr6hyAPzZbxpqpvXu9ag/uXoyeXxQ1393/OvPsNRXMHu9mb4XLgW3l5T8vtGgnf0KpFXaWcpSvaZ1ekegxzYXEd8cdW85UF47kBo673ZZsd0opsjIarmLVE1/uoiopwZCvidckYo097nQzq2dH68L24YZ8xM+IhKypQDpxwCkH1o4bEw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(366004)(136003)(346002)(396003)(478600001)(26005)(8676002)(33656002)(110136005)(55016002)(186003)(316002)(8936002)(9686003)(83380400001)(2906002)(66946007)(7696005)(6506007)(66446008)(71200400001)(66476007)(86362001)(52536014)(66556008)(5660300002)(64756008)(76116006)(53546011); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: 4P9iIOQFm8iLsZTdFLqf+KCu6xvMMb+J+TX6jQ8GgSP1wsCzZWj9NF9u+pmYdEzJLonWO4Ngxo9o+yAdYjEMeSdoeJh523gagqnXcBYo5d0a0ixGbBL034w14ufIzfdblvPr5I+raj9rpwrKRmayUgMYyJghCFNA6RZfAPTp8HdvVAt8RnYE+SC3vZAjKt6cLvQfo6E4JrCWS01lSwjlZgX0maKeAwl3UIkgGgTGm7lFAVby83Q3xyJq6uyYlI+7wAqd1ivKQElQnCK39ySmuvt7/VC2JQhlnE1iByrI6QyhHE76eaYB/SdnYgxDohW0/zOKL6E5FQ5S7HbVq0iJLvOPOlDNnIFrG0Dqa/YOk7X5D/DNVA8Jz3ENIsMHGLcKa67ejPrNfLF3yNF+9LU6MZJHgT8T5zZGFSd2ak1UpcOXsno/aiR4YMy4J1mJgvRYpAIxbfybIi/KMTnsu8X9lVl3ZNmraFgfIBDC96MHrz4WC3VeHOIn1tE1OEx7qusd 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: MN2PR11MB4063.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5d64a2d-b3f3-4ba3-bad1-08d82a289baf X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2020 08:08:36.9819 (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: zssq/qtClSovtKWKeXhO4tIgqnvOCJ3tbwjJOpTRNRfnyZlK7iOK2BofcIDahAUlWX5Elsh/YwaEiqtEndXLHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] vhost: fix missing null dev pointer check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Fu, Patrick > Sent: Thursday, July 16, 2020 11:38 PM > To: dev@dpdk.org; maxime.coquelin@redhat.com; Xia, Chenbo > > Cc: Fu, Patrick > Subject: [PATCH v2] vhost: fix missing null dev pointer check >=20 > From: Patrick Fu >=20 > This patch adds the check of dev pointer in vhost async enqueue completio= n poll. > If a NULL dev pointer detected, the poll function returns immediately. >=20 > Coverity issue: 360839 > Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring") >=20 > Signed-off-by: Patrick Fu > --- > v2: > - change fixline number >=20 > lib/librte_vhost/virtio_net.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.= c index > 1d0be3dd4..235c31e28 100644 > --- a/lib/librte_vhost/virtio_net.c > +++ b/lib/librte_vhost/virtio_net.c > @@ -1635,6 +1635,9 @@ uint16_t rte_vhost_poll_enqueue_completed(int vid, > uint16_t queue_id, > uint16_t start_idx, pkts_idx, vq_size; > uint64_t *async_pending_info; >=20 > + if (!dev) > + return 0; > + > VHOST_LOG_DATA(DEBUG, "(%d) %s\n", dev->vid, __func__); > if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->nr_vring))) { > VHOST_LOG_DATA(ERR, "(%d) %s: invalid virtqueue idx %d.\n", > -- > 2.18.4 Reviewed-by: Chenbo Xia