All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: "peter.maydell@linaro.org" <peter.maydell@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/2] slirp: Fix error reported by static code analysis
Date: Wed, 05 Sep 2012 12:47:33 +0200	[thread overview]
Message-ID: <50472DC5.50402@siemens.com> (raw)
In-Reply-To: <1346793636-23689-3-git-send-email-sw@weilnetz.de>

On 2012-09-04 23:20, Stefan Weil wrote:
> Report from smatch:
> 
> slirp/tcp_subr.c:127 tcp_respond(17) error:
>  we previously assumed 'tp' could be null (see line 124)
> 
> Return if 'tp' is NULL.
> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  slirp/tcp_subr.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
> index 5890d7a..1542e43 100644
> --- a/slirp/tcp_subr.c
> +++ b/slirp/tcp_subr.c
> @@ -124,7 +124,7 @@ tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m,
>  	if (tp)
>  		win = sbspace(&tp->t_socket->so_rcv);
>          if (m == NULL) {
> -		if ((m = m_get(tp->t_socket->slirp)) == NULL)
> +		if (!tp || (m = m_get(tp->t_socket->slirp)) == NULL)
>  			return;
>  		tlen = 0;
>  		m->m_data += IF_MAXLINKHDR;
> 

I suppose this is also stable material, therefore extending CC.

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2012-09-05 10:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04 21:20 [Qemu-devel] [PATCH 0/2] slirp fixes Stefan Weil
2012-09-04 21:20 ` [Qemu-devel] [PATCH 1/2] slirp: Remove wrong type casts ins debug statements Stefan Weil
2012-09-04 21:20 ` [Qemu-devel] [PATCH 2/2] slirp: Fix error reported by static code analysis Stefan Weil
2012-09-05 10:47   ` Jan Kiszka [this message]
2012-09-05 10:47 ` [Qemu-devel] [PATCH 0/2] slirp fixes Jan Kiszka

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=50472DC5.50402@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=sw@weilnetz.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.