From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-f65.google.com (mail-ua1-f65.google.com [209.85.222.65]) by dpdk.org (Postfix) with ESMTP id 5A4274F90 for ; Thu, 2 May 2019 14:22:58 +0200 (CEST) Received: by mail-ua1-f65.google.com with SMTP id t15so633861uao.5 for ; Thu, 02 May 2019 05:22:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1qcBDS2ZEBxwwoSGmE8xRvauTF1BLU8w4M79W69t/QM=; b=W0zcFJ/gmyWm5IRwAH9q86RgFDC2Q+v4YlFO5IVgyfoluwJVY53NdJoV7R+3SE+/Yr Szuu13TgG1YsE20YcVZ3i/ZalwKlA4zkfffKXRWvISocZC2PfmSScec38BxvFrKfudIH 5zhOiD6Q0j0VknVc4XxP70hA4FMcbVTbtgkh4WuVSHECEm9GymW2lfX4D3DpNJRmD0PG xufdq0SbptdTAHBHZwr9ESatHwlmI5uiIdm6uix1XAZeeDUuJ9ecHY4lFn4Uz797tFKl hZyncAn5ULdQDqtt7o1RDpl529CwRahzD6UqC6KkTjQcb4KKBzo6Q1VD7YYIu1aiYQe2 +JFw== X-Gm-Message-State: APjAAAWUFhZ+uw5N2HKKPq1eiv8Ux929lJ+3Qbr3utlAbNG+/F0r9V5S GGR5+Fa7G1vieRoxI0NsUXiMaHvz9LVOog2e7T6jhEHg X-Google-Smtp-Source: APXvYqzRL41src+WbfuwXg3ECC30D41r+4+TJsFyCMLmHZFCPdIwWfN5lMkImwJUuQp4e3fhl5MIfdfFnGtmzsEXDPg= X-Received: by 2002:ab0:14ab:: with SMTP id d40mr1596424uae.41.1556799777793; Thu, 02 May 2019 05:22:57 -0700 (PDT) MIME-Version: 1.0 References: <20190501195014.2938-1-bruce.richardson@intel.com> <20190501195014.2938-4-bruce.richardson@intel.com> In-Reply-To: <20190501195014.2938-4-bruce.richardson@intel.com> From: David Marchand Date: Thu, 2 May 2019 14:22:46 +0200 Message-ID: To: Bruce Richardson Cc: dev , shreyansh.jain@nxp.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 3/4] raw/skeleton_rawdev: fix warnings with GCC 9 on Fedora 30 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: , X-List-Received-Date: Thu, 02 May 2019 12:22:58 -0000 On Wed, May 1, 2019 at 9:51 PM Bruce Richardson wrote: > GCC9 gives warnings if the parameter passed to printf for "%s" could be > NULL, so we need to add checks in some cases to ensure that is not the > case. > > Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver") > Cc: shreyansh.jain@nxp.com > > Signed-off-by: Bruce Richardson > --- > drivers/raw/skeleton_rawdev/skeleton_rawdev.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c > b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c > index d7630fc69..63f2b9a09 100644 > --- a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c > +++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c > @@ -705,6 +705,9 @@ skeleton_rawdev_probe(struct rte_vdev_device *vdev) > > > name = rte_vdev_device_name(vdev); > + if (name == NULL) > + return -EINVAL; > + > /* More than one instance is not supported */ > if (skeldev_init_once) { > SKELETON_PMD_ERR("Multiple instance not supported for %s", > @@ -740,6 +743,8 @@ skeleton_rawdev_remove(struct rte_vdev_device *vdev) > int ret; > > name = rte_vdev_device_name(vdev); > + if (name == NULL) > + return -1; > > SKELETON_PMD_INFO("Closing %s on NUMA node %d", name, > rte_socket_id()); > > -- > 2.21.0 > Tested-by: David Marchand -- David Marchand From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0478DA0AC5 for ; Thu, 2 May 2019 14:22:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CE9945589; Thu, 2 May 2019 14:22:59 +0200 (CEST) Received: from mail-ua1-f65.google.com (mail-ua1-f65.google.com [209.85.222.65]) by dpdk.org (Postfix) with ESMTP id 5A4274F90 for ; Thu, 2 May 2019 14:22:58 +0200 (CEST) Received: by mail-ua1-f65.google.com with SMTP id t15so633861uao.5 for ; Thu, 02 May 2019 05:22:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1qcBDS2ZEBxwwoSGmE8xRvauTF1BLU8w4M79W69t/QM=; b=W0zcFJ/gmyWm5IRwAH9q86RgFDC2Q+v4YlFO5IVgyfoluwJVY53NdJoV7R+3SE+/Yr Szuu13TgG1YsE20YcVZ3i/ZalwKlA4zkfffKXRWvISocZC2PfmSScec38BxvFrKfudIH 5zhOiD6Q0j0VknVc4XxP70hA4FMcbVTbtgkh4WuVSHECEm9GymW2lfX4D3DpNJRmD0PG xufdq0SbptdTAHBHZwr9ESatHwlmI5uiIdm6uix1XAZeeDUuJ9ecHY4lFn4Uz797tFKl hZyncAn5ULdQDqtt7o1RDpl529CwRahzD6UqC6KkTjQcb4KKBzo6Q1VD7YYIu1aiYQe2 +JFw== X-Gm-Message-State: APjAAAWUFhZ+uw5N2HKKPq1eiv8Ux929lJ+3Qbr3utlAbNG+/F0r9V5S GGR5+Fa7G1vieRoxI0NsUXiMaHvz9LVOog2e7T6jhEHg X-Google-Smtp-Source: APXvYqzRL41src+WbfuwXg3ECC30D41r+4+TJsFyCMLmHZFCPdIwWfN5lMkImwJUuQp4e3fhl5MIfdfFnGtmzsEXDPg= X-Received: by 2002:ab0:14ab:: with SMTP id d40mr1596424uae.41.1556799777793; Thu, 02 May 2019 05:22:57 -0700 (PDT) MIME-Version: 1.0 References: <20190501195014.2938-1-bruce.richardson@intel.com> <20190501195014.2938-4-bruce.richardson@intel.com> In-Reply-To: <20190501195014.2938-4-bruce.richardson@intel.com> From: David Marchand Date: Thu, 2 May 2019 14:22:46 +0200 Message-ID: To: Bruce Richardson Cc: dev , shreyansh.jain@nxp.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 3/4] raw/skeleton_rawdev: fix warnings with GCC 9 on Fedora 30 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" Message-ID: <20190502122246.-TZAz0-vGzIC41Pcwze2E5aEwjCS67f4eMN6xEDRnsk@z> On Wed, May 1, 2019 at 9:51 PM Bruce Richardson wrote: > GCC9 gives warnings if the parameter passed to printf for "%s" could be > NULL, so we need to add checks in some cases to ensure that is not the > case. > > Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver") > Cc: shreyansh.jain@nxp.com > > Signed-off-by: Bruce Richardson > --- > drivers/raw/skeleton_rawdev/skeleton_rawdev.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c > b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c > index d7630fc69..63f2b9a09 100644 > --- a/drivers/raw/skeleton_rawdev/skeleton_rawdev.c > +++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev.c > @@ -705,6 +705,9 @@ skeleton_rawdev_probe(struct rte_vdev_device *vdev) > > > name = rte_vdev_device_name(vdev); > + if (name == NULL) > + return -EINVAL; > + > /* More than one instance is not supported */ > if (skeldev_init_once) { > SKELETON_PMD_ERR("Multiple instance not supported for %s", > @@ -740,6 +743,8 @@ skeleton_rawdev_remove(struct rte_vdev_device *vdev) > int ret; > > name = rte_vdev_device_name(vdev); > + if (name == NULL) > + return -1; > > SKELETON_PMD_INFO("Closing %s on NUMA node %d", name, > rte_socket_id()); > > -- > 2.21.0 > Tested-by: David Marchand -- David Marchand