qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: P J P <ppandit@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Gaoning Pan <pgn@zju.edu.cn>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Prasad J Pandit <pjp@fedoraproject.org>
Subject: [PATCH] net: remove an assert call in eth_get_gso_type
Date: Tue, 20 Oct 2020 13:41:19 +0530	[thread overview]
Message-ID: <20201020081119.1578251-1-ppandit@redhat.com> (raw)

From: Prasad J Pandit <pjp@fedoraproject.org>

eth_get_gso_type() routine returns segmentation offload type to use
based on L3 protocol type. It calls g_assert_not_reached if L3
protocol is unknown, making the following return statement unreachable.
Remove the g_assert call, as it maybe triggered by a guest user.

Reported-by: Gaoning Pan <pgn@zju.edu.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
 net/eth.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/eth.c b/net/eth.c
index 0c1d413ee2..f36a418077 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -72,9 +72,6 @@ eth_get_gso_type(uint16_t l3_proto, uint8_t *l3_hdr, uint8_t l4proto)
         }
     }
 
-    /* Unsupported offload */
-    g_assert_not_reached();
-
     return VIRTIO_NET_HDR_GSO_NONE | ecn_state;
 }
 
-- 
2.26.2



             reply	other threads:[~2020-10-20  8:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20  8:11 P J P [this message]
2020-10-20  8:20 ` [PATCH] net: remove an assert call in eth_get_gso_type Philippe Mathieu-Daudé
2020-10-20 10:01   ` P J P

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=20201020081119.1578251-1-ppandit@redhat.com \
    --to=ppandit@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=pgn@zju.edu.cn \
    --cc=pjp@fedoraproject.org \
    --cc=qemu-devel@nongnu.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).