From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: "Mrzyglod, DanielX T" <danielx.t.mrzyglod@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] eal: fix unchecked return value from library
Date: Thu, 21 Apr 2016 11:06:39 +0000 [thread overview]
Message-ID: <C6ECDF3AB251BE4894318F4E45123697820FD5AE@IRSMSX109.ger.corp.intel.com> (raw)
In-Reply-To: <1461239817-96357-1-git-send-email-danielx.t.mrzyglod@intel.com>
> Fix issue reported by Coverity.
> Coverity ID 13194
>
> The function returns a value that indicates an error condition. If this is not
> checked, the error condition may not be handled correctly.
>
> In pci_vfio_mp_sync_thread: Value returned from a library function is not
> checked for errors before being used. This value may indicate an error
> condition.
>
> Fixes: 2f4adfad0a69 ("vfio: add multiprocess support")
>
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> ---
> lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c
> b/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c
> index d9188fd..2b136fc 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c
> @@ -287,7 +287,10 @@ pci_vfio_mp_sync_thread(void __rte_unused * arg)
> struct linger l;
> l.l_onoff = 1;
> l.l_linger = 60;
> - setsockopt(conn_sock, SOL_SOCKET, SO_LINGER, &l,
> sizeof(l));
> +
> + if (setsockopt(conn_sock, SOL_SOCKET, SO_LINGER, &l,
> sizeof(l)) < 0)
> + RTE_LOG(ERR, EAL, "Cannot set SO_LINGER option "
> + "on listen socket (%s)\n",
> strerror(errno));
>
> ret = vfio_mp_sync_receive_request(conn_sock);
>
> --
> 2.5.5
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
next prev parent reply other threads:[~2016-04-21 11:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 11:56 Daniel Mrzyglod
2016-04-21 11:06 ` Burakov, Anatoly [this message]
2016-04-21 16:05 ` Stephen Hemminger
2016-04-22 13:17 ` [dpdk-dev] [PATCH v2] " Daniel Mrzyglod
2016-04-27 14:03 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C6ECDF3AB251BE4894318F4E45123697820FD5AE@IRSMSX109.ger.corp.intel.com \
--to=anatoly.burakov@intel.com \
--cc=danielx.t.mrzyglod@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).