* [dpdk-stable] [PATCH 2/2] vhost: remove unneeded null pointer check
[not found] <20181107090102.9364-1-tiwei.bie@intel.com>
@ 2018-11-07 9:01 ` Tiwei Bie
2018-11-09 11:38 ` Maxime Coquelin
0 siblings, 1 reply; 2+ messages in thread
From: Tiwei Bie @ 2018-11-07 9:01 UTC (permalink / raw)
To: maxime.coquelin, zhihong.wang, dev; +Cc: stable
The caller will guarantee that msg won't be null. Remove
the unneeded null pointer check which caused a Coverity
warning.
Coverity issue: 323484
Fixes: 8f972312b8f4 ("vhost: support vhost-user")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
lib/librte_vhost/vhost_user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index cc154f312..3ea64eba6 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1732,7 +1732,7 @@ read_vhost_message(int sockfd, struct VhostUserMsg *msg)
if (ret <= 0)
return ret;
- if (msg && msg->size) {
+ if (msg->size) {
if (msg->size > sizeof(msg->payload)) {
RTE_LOG(ERR, VHOST_CONFIG,
"invalid msg size: %d\n", msg->size);
--
2.19.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-stable] [PATCH 2/2] vhost: remove unneeded null pointer check
2018-11-07 9:01 ` [dpdk-stable] [PATCH 2/2] vhost: remove unneeded null pointer check Tiwei Bie
@ 2018-11-09 11:38 ` Maxime Coquelin
0 siblings, 0 replies; 2+ messages in thread
From: Maxime Coquelin @ 2018-11-09 11:38 UTC (permalink / raw)
To: Tiwei Bie, zhihong.wang, dev; +Cc: stable
On 11/7/18 10:01 AM, Tiwei Bie wrote:
> The caller will guarantee that msg won't be null. Remove
> the unneeded null pointer check which caused a Coverity
> warning.
>
> Coverity issue: 323484
> Fixes: 8f972312b8f4 ("vhost: support vhost-user")
> Cc: stable@dpdk.org
>
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
> lib/librte_vhost/vhost_user.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index cc154f312..3ea64eba6 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -1732,7 +1732,7 @@ read_vhost_message(int sockfd, struct VhostUserMsg *msg)
> if (ret <= 0)
> return ret;
>
> - if (msg && msg->size) {
> + if (msg->size) {
> if (msg->size > sizeof(msg->payload)) {
> RTE_LOG(ERR, VHOST_CONFIG,
> "invalid msg size: %d\n", msg->size);
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-09 11:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20181107090102.9364-1-tiwei.bie@intel.com>
2018-11-07 9:01 ` [dpdk-stable] [PATCH 2/2] vhost: remove unneeded null pointer check Tiwei Bie
2018-11-09 11:38 ` Maxime Coquelin
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).